Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: gcc....problems..., is there a "Linux for Dummies" book?< Next Oldest | Next Newest >
Neilo Offline





Group: Members
Posts: 12
Joined: Jan. 2005
Posted: Jan. 22 2005,22:03 QUOTE

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.
Back to top
Profile PM 
ke4nt1 Offline





Group: Members
Posts: 2329
Joined: Oct. 2003
Posted: Jan. 22 2005,23:25 QUOTE

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
Back to top
Profile PM 
Neilo Offline





Group: Members
Posts: 12
Joined: Jan. 2005
Posted: Jan. 23 2005,00:00 QUOTE

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?
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Jan. 23 2005,00:45 QUOTE

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
Back to top
Profile PM 
Neilo Offline





Group: Members
Posts: 12
Joined: Jan. 2005
Posted: Jan. 23 2005,01:21 QUOTE

yay :D its compiled, im too used to using m$ visual studio...
Back to top
Profile PM 
4 replies since Jan. 22 2005,22:03 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: gcc....problems...

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code