Hi everyone,
once again I am stuck with a problem and so I humbly ask for the wisdom of the community... this time, the problem is related to Orbiter SDK and C++ /cli.
I am trying to write an Orbiter module using c++ /cli in MS VS 2012.
Whenever I try to compile the code using /clr, I do get the following linker error:
Orbitersdk.lib(Orbitersdk.obj) : error LNK2005: _DllMain@12 is already defined in MSVCRT.lib(dllmain.obj).
Following the MSDN article http://support.microsoft.com/kb/148652/EN-US
I tried to switch the order in which Orbitersdk.lib and msvcrt.lib are compiled. Didn't really do much.
So, I eventuelly got rid of the problem by adding /FORCE:MULTIPLE to the linker command. It compiled, but now it looks like Orbiter is bypassing the InitModule callback of my module, which makes it effectively impossible to use on instance of a class derived from oapi::Module. (However, the callback opcPreStep in the module is still called correctly.)
Well, I figured that /FOCRE:MULTIPLE would break the code and would not be the solution to the initial problem, but it was worth a try.
Long story short, has anyone an idea how I can get rid of the problem between orbiterskd.lib and msvcrt.lib? Any trick to it?
Quite frankly, I have never worked with c++ /cli before, so it's all more or less just try-and-error with a lot of reading and the help of Mister Google. I am not even sure if what I am trying to do is technically feasible...
So, as usual, any help you can provide will be greatly appreciated. :thumbup:
Best regards,
smarly
once again I am stuck with a problem and so I humbly ask for the wisdom of the community... this time, the problem is related to Orbiter SDK and C++ /cli.
I am trying to write an Orbiter module using c++ /cli in MS VS 2012.
Whenever I try to compile the code using /clr, I do get the following linker error:
Orbitersdk.lib(Orbitersdk.obj) : error LNK2005: _DllMain@12 is already defined in MSVCRT.lib(dllmain.obj).
Following the MSDN article http://support.microsoft.com/kb/148652/EN-US
I tried to switch the order in which Orbitersdk.lib and msvcrt.lib are compiled. Didn't really do much.
So, I eventuelly got rid of the problem by adding /FORCE:MULTIPLE to the linker command. It compiled, but now it looks like Orbiter is bypassing the InitModule callback of my module, which makes it effectively impossible to use on instance of a class derived from oapi::Module. (However, the callback opcPreStep in the module is still called correctly.)
Well, I figured that /FOCRE:MULTIPLE would break the code and would not be the solution to the initial problem, but it was worth a try.
Long story short, has anyone an idea how I can get rid of the problem between orbiterskd.lib and msvcrt.lib? Any trick to it?
Quite frankly, I have never worked with c++ /cli before, so it's all more or less just try-and-error with a lot of reading and the help of Mister Google. I am not even sure if what I am trying to do is technically feasible...
So, as usual, any help you can provide will be greatly appreciated. :thumbup:
Best regards,
smarly