DrWatt
Group: Members
Posts: 91
Joined: Nov. 2003 |
|
Posted: Jan. 14 2004,14:37 |
|
Thanks enthusi. I had tried to run tcc also and got the same sorts of errors as reported. At the time, I didn't have the time to figure it out, but the secret was the missing line
#include "/usr/lib/tcc/include/tcclib.h"
For those who know a smattering of C this line replaces the usual #include statements, such as #include <stdio.h>. Apparently a lot of the usual header files in tcc are inluded in the tcclib.h file. There are several other header files to explore in the tcc library files.
The other secret to getting immediate output is the -run opion in the command. For example, in a "c" file called test.c you would type
tcc -run test.c
This assumes you don't want to use the run script you provided.
Here is my test.c traditional first "c" file:
#include "/usr/lib/tcc/include/tcclib.h" main() {
printf("Hello DSL world");
return 0; }
A good thing to do is to backup the old "/usr/share/scite/cpp.properties" file (in case you want to use it to compile gcc files in the future) and modify it so that you can compile link and run in scite. The output will appear in a separate pane on the right. Very handy. Here are the mods to the file:
1. After the line that reads "cc=g++ -pedantic -Os -fno-exceptions -fvtable-thunks -c $(FileNameExt) -o $(FileName).o" add a line that reads:
"tcc=tcc -run $(FileNameExt)"
2. Change all the lines that read "command.compile.*.c=$(cc)" to
"command.compile.*.c=$(tcc)"
there are 4 such instances. Save it. You must make the changes to this library file as root or it won't let you save them.
Now, you can edit in scite and use the "Complie command under tools to test your programs. Very nifty indeed. Standard c files should work.
|