943,815 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 11662
  • C++ RSS
Jul 5th, 2007
0

compiling using g++ results to undefined reference

Expand Post »
I'm running my program in linux v. 2.6.20 and gcc v. 4.1.2...i got a problem here...when i compile my source code .cpp using gcc there's no error... but when i compile using g++ there's an error "undefined reference".
sample:

File.cpp: (.text+0xc50): Undefined reference to 'ClassB::Close'

what's the problem with this?

thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
go939 is offline Offline
6 posts
since Jun 2007
Jul 5th, 2007
-1

Re: compiling using g++ results to undefined reference

Must be something to do with the way you're using them.. parameters etc.. see which object file or .so or .a file contains teh required symbols and add that on link cmd..
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
Jul 6th, 2007
0

Re: compiling using g++ results to undefined reference

i already check my source code and all the include files were linked together...the only problem was that the Classes of B were undefined reference to my main source code....
Reputation Points: 10
Solved Threads: 0
Newbie Poster
go939 is offline Offline
6 posts
since Jun 2007
Jul 7th, 2007
0

Re: compiling using g++ results to undefined reference

Maybe the function isn't defined in any of your source code files?
Reputation Points: 683
Solved Threads: 53
Posting Virtuoso
Infarction is offline Offline
1,580 posts
since May 2006
Jul 7th, 2007
0

Re: compiling using g++ results to undefined reference

Post your code.

If that isn't practical, create a small test case which shows the same symptoms, and post that.

Post the actual command lines you used to compile your code, and actual error message(s) you get in response.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Errors during programing in c++
Next Thread in C++ Forum Timeline: user given array size





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC