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

    Question functions were discarded on build of a dll with visual c++ 8.0

    Hello,

    I want to build a dll library with visual c++ 8.0 and got an "unresolved symbol" linker error message when trying to use the library with an application. So I checked the dll library with dependency walker for the exported functions, the needed functions were missing in the library.
    I then dumped the corresponding object file with dumpbin.exe, the function was declared as public, like the other exported functions.
    On the next step, I set the verbose switch for link.exe.
    The verbose log told me, that the function was discarded on the linker run.

    Can someone tell me, what can lead to that behaviour of the visual c++ linker ?

    Thanks very much for your help.

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: functions were discarded on build of a dll with visual c++ 8.0

    Are these functions declared with __declspec(dllexport) ?

  3. #3
    Join Date
    Dec 2012
    Posts
    3

    Re: functions were discarded on build of a dll with visual c++ 8.0

    Hello Alex,

    the functions are declared with "extern int __stdcall (...)".

  4. #4
    Join Date
    Dec 2012
    Posts
    3

    Re: functions were discarded on build of a dll with visual c++ 8.0

    Hello Alex,

    thanks for your help. You have shown me the right way for the problem solution.

    The GNU library I want to use in my application exports not with the keyword __declspec(dllexport), its done by a .def file and that causes the linker to discard the functions, that are not defined in the .def file. Now I understand the build of this GNU library.

    Greetings

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