C++ Question MSVCRTD.lib gives R6033 error on runtime

escapetomsfate

OBSP Developer
Addon Developer
Joined
Jun 21, 2008
Messages
282
Reaction score
0
Points
0
Location
GB
Hi.

My PC has just had a hard drive rewipe, which has erased all my VC++ projects :(

Today, I tried to reinstall the compiler (VC++ 2008). ShuttlePB compiles fine. But when I try MFDTemplate, it gives me this;

orbitersdk.lib(Orbitersdk.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)

So I told it to ignore MSVCRTD.lib. It compiled fine. copied the DLL into Orbiter and acivated - I get a R6033 Runtime Error and Orbiter dies.

I've googled around, but found no soultion that works. For some reason, it compiles if I open the project included in the SDK, but not if I copy over the files. The settings on the project seem identical.

Can anyone help me? Thanks.
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
Does this help at all? Are you compiling a CLR module?

C Run-Time Error R6033

Error Message

Attempt to use MSIL code from this assembly during native code initialization. This indicates a bug in your application. It is most likely the result of calling an MSIL-compiled (/clr) function from a native constructor or from DllMain.

This diagnostic indicates that MSIL instructions were executing during loader lock. For more information, see Initialization of Mixed Assemblies.
 

escapetomsfate

OBSP Developer
Addon Developer
Joined
Jun 21, 2008
Messages
282
Reaction score
0
Points
0
Location
GB
Thanks for the help.

I've looked through those pages before, and changed it to "No common Runtime support" which results in loads of errors. Are you meant to change this for Orbiter? I haven't done in the past.
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
CLR is (I think) required for .NET languages, so if you're using the .NET framework in your DLL, then you'll need have it enabled. If not, then there is no reason to have the common language library runtime support.
 

escapetomsfate

OBSP Developer
Addon Developer
Joined
Jun 21, 2008
Messages
282
Reaction score
0
Points
0
Location
GB
Ok, I just turned CLR off and it works :D all those errors were me forgetting to include user32.lib etc....

Thanks (Diolch yn fawr =P).
 
Top