LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-21-2003, 01:52 PM   #1
nakkaya
LQ Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
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?
 
Old 04-21-2003, 02:33 PM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,185

Rep: Reputation: 52
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.
 
Old 04-21-2003, 03:17 PM   #3
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
That is because you are compiling a C++ program with a C compiler

Try using g++ instead.
 
Old 04-21-2003, 03:44 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
And make sure you don't need to add -lsomething when you link the program (for example '-lm' when you're using mathematical functions).
 
Old 04-21-2003, 05:11 PM   #5
nakkaya
LQ Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Original Poster
Rep: Reputation: 45
aghhhh s*it thanks guy never checked it yeah i was using gcc sorry my stupidty
 
Old 04-21-2003, 06:15 PM   #6
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Solved Problem Second GCC-Pass(or gettext sanity check problem) hoes Linux From Scratch 0 09-04-2005 11:20 AM
gcc problem skguha Linux - Software 3 05-06-2004 08:03 AM
problem with gcc ptwobrussell Linux - Software 4 09-08-2003 05:58 PM
gcc problem chief Linux - Software 2 07-24-2003 05:23 PM
gcc 3.3 problem darthczyz Linux - Software 6 05-20-2003 11:42 AM


All times are GMT -5. The time now is 02:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration