LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gcc problem (https://www.linuxquestions.org/questions/linux-software-2/gcc-problem-56110/)

nakkaya 04-21-2003 12:52 PM

gcc problem
 
when i wrote a prog in c++ and try to compile it i get pages of eroors it is carrect and there is no error because when there is error it reports it but when it becames correct and try to compile it i get

undefined reference to everything i couldnt get the errors with

gcc example.cpp -o example >error.txt

so i coulndt post it any idea why?

whansard 04-21-2003 01:33 PM

if you did it in an xterm, you could cut n paste
the errors.
it looks like like you are just creating an
executable error.txt, but thats just a guess.

wapcaplet 04-21-2003 02:17 PM

That is because you are compiling a C++ program with a C compiler :)

Try using g++ instead.

Mara 04-21-2003 02:44 PM

And make sure you don't need to add -lsomething when you link the program (for example '-lm' when you're using mathematical functions).

nakkaya 04-21-2003 04:11 PM

aghhhh s*it thanks guy never checked it yeah i was using gcc sorry my stupidty

wapcaplet 04-21-2003 05:15 PM

Quote:

Originally posted by nakkaya
aghhhh s*it thanks guy never checked it yeah i was using gcc sorry my stupidty
No prob. I've made the same mistake myself a few times... :D


All times are GMT -5. The time now is 12:49 AM.