views:

295

answers:

2

Hello,

I am using Eclipse Galileo 3.5 with CDT 6.0

I am having a problem in including the header files located in c:\cs106 ... I searched on google and found that I have to go to Project Properties > C/C++ General > Paths and Symbols and in GNU C++ I have added the path c:\cs106

And eclipse is able to find them now but the other problem I am getting is that when I try to build a simple program which is using a function defined in "simpio.h" located in c:\cs106 and I have already included at the top of my program #include "simpio.h" but it is giving me an error

**** Internal Builder is used for build ****
g++ -IC:\cs106 -O0 -g3 -Wall -c -fmessage-length=0 -osrc\CS106.o ..\src\CS106.cpp
g++ -oCS106.exe src\CS106.o
src\CS106.o: In function `main':
C:/Users/User/workspace/CS106/Debug/../src/CS106.cpp:8: undefined reference to `GetInteger()'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 986 ms.

I googled and what I get is that I have to to tell the linker for a .lib file that is accompanied with the header files. in my case the provided .lib file is (CS106CPPLib.lib) and I checked with the project file that I got was of VS 2008 and saw that they have added the following statement in the project settings file under VCLinkerTool: AdditionalDependencies="c:\cs106\CS106CPPLib.lib winmm.lib"

So I think I have to include this CS106CPPLib.lib winmm.lib in eclipse as well but I am unable to figure out where should I do this. Please if someone can help me I will be really grateful.

If you need any more info please reply me.

Thanks

A: 

you need to define explicitly library's name in your project... in project setting somewhere if you already done that... that function is not there in library... Probably you need to add another lib file in which function's definition is there...

mihirpmehta
Thanks for your reply. I want to tell you that the functions definition is already defined in the c:\cs106\CS106CPPLib.lib winmm.lib as it is working in visual studio but I want to get it working in eclipse as I like eclipse environment very much.
It clearly says that it can't find GetInteger() function anywhere...have you explicitly link winmm.lib file in your eclipse environment if not please link it explicitly... and use Absolute Path in library Path rather than relative Paththese might fix the problem
mihirpmehta
Thanks mate but I am unable to figure out how to do that.. I am an absolute beginner can you tell me how to do that.. step by step..Thanks
I have successfully linked the file you can check this screenshot but again it is giving me the error.http://i41.tinypic.com/16k0tj7.jpgError ScreenShot:http://i43.tinypic.com/1074egm.jpgIt is working perfect in Visual Studio but I want it to work in Eclipse..
A: 

Hi Ahmed

Can you let me know how you compiled the program in VS2008. I am not able to do it.

Pramod

pramodp
It easily compiles the program in VS 2008 what is the difficulty you are facing ?