编译出现如下错误
nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in QQInfo.obj
nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in QQInfo.obj; second definition ignored
Creating library Debug/QQInfo.lib and object Debug/QQInfo.exp
Debug/QQInfo.dll : fatal error LNK1169: one or more multiply defined symbols found
解决方法:
project setting->C/C++, 在category中选择Preprocessor,将preprocessor definitions中的_USRDLL删除即可。
网上查找过程中,MSDN也有一些应对资料
几种解决方案内容如下:
There are two ways to resolve this problem. The first solution involves forcing the linker to link the libraries in the correct order. The second solution allows you to find the module that is causing the problem and to correct it.
Note The following steps are based on Visual C++ 6.0.
Solution One: Force Linker to Link Libraries in Correct Order
To view the current library link order, follow these steps:
- On the Projectmenu, click Settings.
- In the Settings For view of theProject Settings dialog box, click to select the projectconfiguration that is getting the link errors.
- On the Link tab, type/verbose:lib in theProject Optionsbox.
- Rebuild your project. The libraries will be listed in theoutput window during the linking process.