|
-
December 9th, 2008, 08:52 AM
#1
static libraries
Hi !
I have build a static library using this tutorial : http://msdn.microsoft.com/en-us/libr...27(VS.80).aspx .
The problem I have is that i cannot use its functions inside of the test application - MyExecRefLib .
I am using Visual Studio 6.0 .
Inside MyExecRefLib , i included a folder with the following structure: MyExecRefLib/dumi/lib/MathFuncsLib.lib and MyExecRefLib/dumi/include/MathFuncsLib.h
Also, in the test application - MyExecRefLib, i tried to modify the include directories paths as follows : [BR]
Project->Setting->C/C++ - project Options : i added : /I "dumi"
Project->Settings->Link - project Options : i added /libpath:"dumi\lib"
After this , i am getting the following error :
fatal error C1083: Cannot open include file: 'MathFuncsLib.h': No such file or directory
Error executing cl.exe.
If i change : /I "dumi" with
with /I "dumi\include" at Project->Setting->C/C++ - project Options , the error changes to :
error LNK2001: unresolved external symbol "public: static double __cdecl MathFuncs::MyMathFuncs: ivide(double,double)" (?Divide@MyMathFuncs@MathFuncs@@SANNN@Z)
.
I have seen on other forums that this is a common problem for many people, but i didn't find yet a proper solution.
D.M.
-
December 9th, 2008, 09:02 AM
#2
Re: static libraries
Looks like you fixed the compile error, and just haven't figured out linking yet.
I don't know the Visual Studio command-line options, but did you specify your library as an input to the linker in your project options?
-
December 9th, 2008, 10:24 AM
#3
Re: static libraries
Project Options -> Link -> Object/library modules:
Add "MathFuncsLib.lib" to the list.
gg
-
December 9th, 2008, 10:35 AM
#4
Re: static libraries
I have added the library to the linker liberies and modules , but now I get the following error :
LINK : fatal error LNK1104: cannot open file "MyMathLib.lib"
Error executing link.exe.
D.M.
-
December 9th, 2008, 10:37 AM
#5
Re: static libraries
OK , I added My MathFuncsLib.lib , and now it works !
Thanks a lot !
D.M.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|