gcc....problems...


Forum: Other Help Topics
Topic: gcc....problems...
started by: Neilo

Posted by Neilo on Jan. 22 2005,22:03
I've never used it before, and I cant seem to get it to compile a simple program...

#include <iostream>

using namespace std;

int main()
{
cout << "Hello, world" << endl;
return 0;
}

Won't work with even a good old stdio.h & printf hello world, not a clue why. to compile im just typing in:

gcc hello.cpp

and getting stuff like "/tmp/ccT98qqb.o(.text+0x1b): In function 'main': undefined reference to std::cout....then a load of other similar errors. I am absolutely lost.

Posted by ke4nt1 on Jan. 22 2005,23:25
DSL had tcc compiler built-in..

Try this...

#include <tcclib.h>

int main(void)
{
 printf("Hello World!\n");
 return 0;
}

Let us know how it works for you.

If you wish to use gcc, try this..
Change your sources.list in /etc/apt from the stable branch to unstable.
Then, type ' apt-get install gcc g++ make '

There is also the kernelsources.dsl in the repository,
if you need those for your project..  

73
ke4nt

Posted by Neilo on Jan. 23 2005,00:00
tcclib.h: No such file or directory. I'm guessing there are some libraries I need to download so I can actually get cracking with some programming?
Posted by clacker on Jan. 23 2005,00:45
Neilo, try compiling your program with g++ instead of gcc.  g++ is the c++ compiler; gcc is the c compiler.  You should be ok then.

g++ -o hello hello.cpp

Posted by Neilo on Jan. 23 2005,01:21
yay :D its compiled, im too used to using m$ visual studio...
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.