How to link a static library in Visual C++ 2008?

前端 未结 3 692
我在风中等你
我在风中等你 2021-01-16 09:29

My VC++ solution includes two projects, an application (exe) and a static library.

Both compile fine, but fail to link. I\'m getting an \"unresolved external symbol\

3条回答
  •  半阙折子戏
    2021-01-16 10:05

    It looks like the exported functions in the static library have the wrong calling convention. How does the header file for the exported functions look like?

    Ok, so the functions are using UDT_API as prefix. They shouldn't if you are just creating a static .lib to link against.

    An alternative is to change the lib to create a dll instead. So you create static linkage with a dll. Only problem is that you have to provide the dll with your app. Still not a bad solution, since it enables you to do fixes in the lib.

提交回复
热议问题