CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2008
    Posts
    26

    Cool 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.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    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?

  3. #3
    Join Date
    Nov 2003
    Posts
    1,902

    Re: static libraries

    Project Options -> Link -> Object/library modules:
    Add "MathFuncsLib.lib" to the list.

    gg

  4. #4
    Join Date
    Dec 2008
    Posts
    26

    Unhappy 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.

  5. #5
    Join Date
    Dec 2008
    Posts
    26

    Thumbs up 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
  •  





Click Here to Expand Forum to Full Width

Featured