943,547 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 668
  • C++ RSS
Aug 1st, 2007
0

Help !! With the error Posted..

Expand Post »
Hi All,
Please Help me out with this below mentioned error.

C++ Syntax (Toggle Plain Text)
  1. librohit.a: undefined reference to `MODEL_NAME'
  2. librohit.a: undefined reference to `FT_MODEL'
  3. librohit.a: undefined reference to `STOCK_MODEL'
  4. librohit.a: undefined reference to `FUTURE_MODEL'
  5. librohit.a: undefined reference to `COArgs::COArgs()'
  6. librohit.a: undefined reference to `std::strstreambuf::freeze(int)'
  7. librohit.a: undefined reference to `RWMutex::wLock()'
  8. librohit.a: undefined reference to `OUTSTRIKE_PARAMETERS'
  9. librohit.a: undefined reference to `sec_login_sql_client'
  10. librohit.a: undefined reference to `sec_login_ctor'
  11. librohit.a: undefined reference to `RWMutex::wUnlock()'
  12. librohit.a: undefined reference to `RWMutex::rLock()'
  13. librohit.a: undefined reference to `RWMutex::rUnlock()'
  14. librohit.a: undefined reference to `String::String(char)'
  15. librohit.a: undefined reference to `String::hashval() const'
  16. collect2: ld returned 1 exit status
  17.  

Thanks
Rohit
Similar Threads
Reputation Points: 25
Solved Threads: 0
Light Poster
RohitSahni is offline Offline
35 posts
since Jul 2007
Aug 1st, 2007
1

Re: Help !! With the error Posted..

I am trying to build exe bbut getting the following above said error..
I am tring to build below mention code.

C++ Syntax (Toggle Plain Text)
  1. #include <iostream>
  2. #include <fstream.h>
  3. #include <stdlib.h>
  4.  
  5. #include "RohitSahni/String.h"
  6.  
  7. using namespace std;
  8. int main(int argc, char **argv)
  9. {
  10. String testString("Hellow");
  11. cout << "*********"<<testString.c_str();
  12.  
  13.  
  14.  
  15. }


In the above code i have defined my own String claa inherited from std::string.

Plz Help

Thanks
Rohit
Reputation Points: 25
Solved Threads: 0
Light Poster
RohitSahni is offline Offline
35 posts
since Jul 2007
Aug 1st, 2007
0

Re: Help !! With the error Posted..

line 2: unless you are using a very old compiler such as the original Turbo c++ you should be using header files without the .h extension because there have been some changes.

You should have named your derived string something other than String.h because that is already the name of standard C string functions. Its not good to duplicate file names like that because it will eventually become confusing.

My guess about your specific problem is that you did not include one or more required libraries in the project. Did you include the implementation code for your derived class ?
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is online now Online
21,947 posts
since Aug 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: Turbo C compiler error
Next Thread in C++ Forum Timeline: Equivalent ofstream to MFC





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


Follow us on Twitter


© 2011 DaniWeb® LLC