• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 lnk2038 error in simconnect.lib

DragonflightDesign

Resource contributor
Messages
1,389
Country
northernireland
I've only just started building 64-bit gauges for P3Dv4 and I'm not very familiar with the 64-bit process, so I'm taking a very large bet that I've overlooked something really simple. I'm getting multiples of these two errors during compilation:-

LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in conversions.obj (my projectname) - P3Dv4 D:\Flight Simulator Development\(my projectname)\code\(my projectname) - P3Dv4\(my projectname) - P3Dv4\simconnect.lib(SimConnectClient.obj)

Severity Code Description Project File Line Suppression State
Error LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in conversions.obj (my projectname) - P3Dv4 D:\Flight Simulator Development\(my projectname)\code\(my projectname) - P3Dv4\(my projectname) - P3Dv4\simconnect.lib(SimConnectClient.obj) 1

Please forgive the obfuscation of the real project name with (my projectname) but I'm not ready to reveal just yet what I'm working on.

Thank you.
 
This may be a release/debug issue. I think there is a simconnetdebug.lib you can link to while you debug your code. Or just set you project to release. You can google _ITERATOR_DEBUG_LEVEL and set the debug level the same as the simconnect.lib file too. Have not really done gauge programming, so maybe someone else knows better.
 
I made the following addition to simconnect.h

#ifdef _DEBUG
#pragma comment (lib, "simconnect_debug.lib")
#else
#pragma comment (lib, "simconnect.lib")
#endif
 
That's not it, Doug. I still get the same errors plus a really, really silly one. Ignoring the typo (it's simconnectdebug.lib :)), if I add the #ifdef to the simconnect.h file it says it can't find simconnectdebug.lib - which is in the same folder - but it's quite happy to find simconnect.lib - which is also in the same folder! If I give simconnectdebug.lib the full path then the compiler is happy. Go figure..!

I've tried adding both libs to the Additional Dependencies in the Linker but that didn't help.

I've also got a slew of "C4838: conversion from 'unsigned int' to 'FLAGS' requires a narrowing conversion" warnings, one for each MOUSE_BEGIN structure but I'll worry about those later.
 
Just an update in case anyone else gets the same problem. I was trying to convert an existing 32-bit FSX project to P3Dv4 64-bit standard. When I started again from scratch on a completely new gauge, the compiler stopped barfing on everything except the 'narrowing conversion' warning. Evidently a problem with one or more of my existing header files and I'm not looking forward to locating it.

As for the 'narrowing conversion' warning: as the new gauge works properly in P3Dv4, if I can't stop the warning nicely then at least I have the option of hitting it with a pragma 4996. I don't really want to go that route though.
 
What i've found is, you may change in Configuration Properties->C/C++->Preprocessor-> Preprocessor Definitions "_DEBUG" to "NDEBUG" I don't remember exactly where i read it but, it works for me. Also in the LM SDK Samples you may erase all the entries and leave just _WINDLL.
Also tested and it works perfectly.

Hope it helps.
 
Post the narrowing conversion warnings? If it is related to the mouse macros then all you need to do is cast your mouse event flags using a (FLAGS) type cast and they will go away.
 
Sounds like you've been there... :) Yep, that's it. However, I'm uncertain where to add the cast in this case.
 
The cast is on the mouse event flags (ie left single, right single etc).

If you read the warning, you will notice it is trying to convert from an unsigned int to FLAGS which is defined as straight int which by default is a signed integer. The mouse event flags are all defined as BIT constants however those constants are treated as unsigned integers due to constant being a hexadecimal number.
 
Back
Top