编译Bullet物理和静态库一起提升

编译Bullet物理和静态库一起提升

问题描述:

我开发了被称为轨道空间飞行模拟器插件: HTTP://orbit.medphys.ucl。 ac.uk/

I develop addons for a space flight simulator called Orbiter: http://orbit.medphys.ucl.ac.uk/

它接受插件,dll文件。我最近它使用了Bullet物理库以及插件。其静态链接到DLL,所以子弹库本身并不是一个DLL,但是编译右转入插件。子弹是与调试释放和多线程调试(/ MTD)

It accepts plugins as dll files. I recently made a plugin which uses the Bullet physics library as well. Its statically linked to the dll, so the bullet library is itself not a dll but compiled right into the plugin. Bullet is compiled with Multi-threaded (/MT) option for the release and Multi-threaded Debug (/MTd) for debug

现在我想用线程加速。所以,我选择从升压临安装2静态选项来安装静态Boost库。我能够成功创建这些静态库一个双赢32的应用程序。应用程序中使用多线程(/ MT)以及。所以,我知道有对标志没有不匹配。

Now I want to use threads from Boost. So I installed the static Boost libraries by choosing the 2 static options from the Boost Pro installer. I was able to successfully create a Win 32 application with these static libraries. The application used Multi-threaded (/MT) as well. So I know that there is no mismatch on the flags.

然而,当我添加加速到我的轨道飞行器DLL插件项目,其中也有子弹,我得到一个链接错误:

Yet, when I add Boost to my Orbiter dll plugin project, which also has Bullet, I get a link error :

1> ------启动生成:项目:凹凸,配置:发行的Win32 ------

1>------ Build started: Project: Bump, Configuration: Release Win32 ------

1> C:\\ Program Files文件(x86)的\\的MSBuild \\ Microsoft.Cpp \\ V4.0 \\ Microsoft.CppBuild.targets(990,5):警告MSB8012:TARGETPATH​​(F:\\轨道\\ Orbitersdk \\样本\\ BumpThreaded \\发布\\ Bump.dll)不链接器的OUTPUTFILE属性值匹配(F:\\轨道\\模块\\插件\\ Bump.dll)。这可能会导致您的项目,以建立不正确。为了解决这个问题,请确保$(OUTDIR)$(的TargetName)和$(TargetExt)的属性值(Link.OutputFile)在%指定的值相匹配

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(F:\Orbiter\Orbitersdk\samples\BumpThreaded\Release\Bump.dll) does not match the Linker's OutputFile property value (F:\Orbiter\Modules\Plugin\Bump.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

1> MSVCRT.LIB(ti_inst.obj):错误LNK2005:民营:__thiscall TYPE_INFO :: TYPE_INFO(类TYPE_INFO常量和放大器;)(?? 0type_info @@ AAE @ ABV0 @@ Z)已经LIBCMT定义.LIB(typinfo.obj)

1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)

1> MSVCRT.LIB(ti_inst.obj):错误LNK2005:民营:类TYPE_INFO&放大器; __thiscall TYPE_INFO ::运算符=(类TYPE_INFO常量和放大器;)(?? 4type_info @@ AAEAAV0 @ ABV0 @@ž )在LIBCMT.LIB已定义(typinfo.obj)
1>创建库F:\\轨道\\ Orbitersdk \\ SAMPLES \\ BumpThreaded \\发布\\ Bump.lib和对象F:\\轨道\\ Orbitersdk \\ SAMPLES \\ BumpThreaded \\发布\\ Bump.exp

1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1> Creating library F:\Orbiter\Orbitersdk\samples\BumpThreaded\Release\Bump.lib and object F:\Orbiter\Orbitersdk\samples\BumpThreaded\Release\Bump.exp

1> LINK:警告LNK4098:defaultlibMSVCRT与其他使用林达冲突;使用/ NODEFAULTLIB:库
1> ...... \\模块\\插件\\ Bump.dll:致命错误LNK1169:找到一个或多个多重定义的符号

1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library 1>......\Modules\Plugin\Bump.dll : fatal error LNK1169: one or more multiply defined symbols found

==========生成:0成功,1失败,3可达最新,0已跳过==========

========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

从我其它问题阅读,这可以在应用程序中使用2库是由于不匹配的标志。但在这里,多数民众赞成并非如此。这两种子弹和升压被编译/吨。

From what I read on other questions, this can be due to mismatched flags for 2 libraries being used within an application. But thats not the case here. Both Bullet and Boost are compiled with /MT.

也助推OK作品使用普通赢得32应用程序,因此它联系起来的原因问题,当静态输出一个dll?

Also boost works ok with a normal win 32 application, so why the problem when linking it statically to output a dll ?

我使用Visual Studio 2010的前preSS和有一个Windows 7 64位系统。

I use visual studio 2010 express and have a windows 7 64 bit system.

感谢任何帮助提前:)

如果你只使用升压和子弹,而这些都与肯定 / MT 编译那么它必须是正在使用您的凹凸DLL本身 / MD

If you're only using Boost and Bullet, and these are both definitely compiled with /MT, then it must be your Bump dll itself which is using /MD.