Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Const char error 1

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
Hi!

I have made a const char as follows:
char const Ccode [] =
"#include <stdio.h>\n"
"#include <stdlib.h>\n"
"#include <math.h>\n"
"include <tcl.h>\n"
"#include <tk.h>\n"
"\n"
"#define TCLGO TCL_GLOBAL_ONLY\n"
"main(int argc, char *argv[])\n"
"{\n"
" Tcl_Interp *interp;\n"
" Tk_Window mainWindow;\n"
" Tk_Window tkmain;\n"
" int error;\n"
" char *trace;\n"
" \n"
"/* first we create a Tcl interpreter */\n"
"\n"
" interp = Tcl_CreateInterp();\n"
"\n"
"/* now we create a Tk main window */\n"
"\n"
" tkmain = Tk_MainWindow(interp);\n"
"\n"
"/* now we initialize our interpreter for Tcl,Tk,and our personal\n"
" example C commands */\n"
"\n"
" if(Tcl_Init(interp) != TCL_OK) {\n"
" fprintf(stderr, "Tcl_Init failed: %s\n", interp->result);"\n"
" }\n"
" if(Tk_Init(interp) != TCL_OK) {
" fprintf(stderr, "Tk_Init failed: %s\n", interp->result);
" }\n"
....


And I get errors when compiling it seems at lines like
" fprintf(stderr, "Tcl_Init failed: %s\n", interp->result);"\n"

What should I do then?

Thanks!

 
Please use [tt][ignore]
Code:
[/ignore][/tt]
tags when posting code.

Follow the "Process TGML" link at the bottom of the edit window for more information.

--
 
Salem: OK I'll do it next time

DaveSinkula: Thanks. so Do I have to remove the \n? DO you know a quick way to read in a tcl or C file and store it into a Char const. I am doing it manually but for longer code..
 
don't worry I found how to do this. Thanks for your help!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top