954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help !! With the error Posted..

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

librohit.a: undefined reference to `MODEL_NAME'
librohit.a: undefined reference to `FT_MODEL'
librohit.a: undefined reference to `STOCK_MODEL'
librohit.a: undefined reference to `FUTURE_MODEL'
librohit.a: undefined reference to `COArgs::COArgs()'
librohit.a: undefined reference to `std::strstreambuf::freeze(int)'
librohit.a: undefined reference to `RWMutex::wLock()'
librohit.a: undefined reference to `OUTSTRIKE_PARAMETERS'
librohit.a: undefined reference to `sec_login_sql_client'
librohit.a: undefined reference to `sec_login_ctor'
librohit.a: undefined reference to `RWMutex::wUnlock()'
librohit.a: undefined reference to `RWMutex::rLock()'
librohit.a: undefined reference to `RWMutex::rUnlock()'
librohit.a: undefined reference to `String::String(char)'
librohit.a: undefined reference to `String::hashval() const'
collect2: ld returned 1 exit status


Thanks
Rohit

RohitSahni
Light Poster
35 posts since Jul 2007
Reputation Points: 25
Solved Threads: 0
 

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

#include <iostream>
#include <fstream.h>
#include <stdlib.h>

#include "RohitSahni/String.h"

using namespace std;
int main(int argc, char **argv)
{
			String testString("Hellow");
			cout << "*********"<<testString.c_str();
			
			
    			
   }

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

Plz Help

Thanks
Rohit

RohitSahni
Light Poster
35 posts since Jul 2007
Reputation Points: 25
Solved Threads: 0
 

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 ?

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You