开发者

How do I link a VS2008 C++ project as a DLL instead of a LIB?

开发者 https://www.devze.com 2022-12-23 15:05 出处:网络
I have the C++ source code in a Visual Studio project from another developer that compiles into a static lib开发者_StackOverflow.I need to change it so that it builds a dll from that code so that I ca

I have the C++ source code in a Visual Studio project from another developer that compiles into a static lib开发者_StackOverflow. I need to change it so that it builds a dll from that code so that I can call it from C#. I went into the project properties in Visual Studio and changed the configuration type to a DLL. However, it now gives lots of linker errors like:

error LNK2001: unresolved external symbol __CAP_Enter_Function  XXXFilter.obj XXXFramework

What else do I need to do in Visual Studio and in the code to produce a dll from the code instead of a lib? The library is huge so writing a wrapper is not an option. I have the code so I should be able to make it build a dll.

I am not a very experienced C++ dev but I am in C# and visual studio. The C++ command line is:

/Od /Oi /D "_DEBUG" /D "_XBOX" /D "XBOX" /D "_XBOX_CRT_DEPRECATE_INSECURE" /D "_MBCS" /FD /MTd /Yu"stdafx.h" /Fp"Debug/AtgFramework.pch" /Fo"Debug\" /Fd"Debug\vc80.pdb" /W4 /nologo /c /Zi /TP

Thanks


Somewhere in the C++ project someone has used the /callcap Visual C++ argument. I don't think there is a C++ setting for it so it's most likely in the "Additional options" / "Command Line" section. Remove the option and it should link ok.

0

精彩评论

暂无评论...
验证码 换一张
取 消