Compiler warning in VS2017

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Post Reply
aivlasoft
Posts: 7
Joined: Mon Apr 02, 2012 7:56 pm

Compiler warning in VS2017

Post by aivlasoft »

Hello,

when compiling source code which is referencing SimConnect.dll (*1) from v5 SDK I'm getting the following compiler warning:
------------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\
Bin\Microsoft.Common.CurrentVersion.targets(2110,5):
warning MSB3270: There was a mismatch between the processor architecture of
the project being built "MSIL" and the processor architecture of the reference
"LockheedMartin.Prepar3D.SimConnect", "AMD64".
This mismatch may cause runtime failures. Please consider changing the targeted
processor architecture of your project through the Configuration Manager so as to align
the processor architectures between your project and references, or take a dependency
on references with a processor architecture that matches the targeted processor
architecture of your project.
------------

I guess that the fixed processor architecture AMD64 should be replaced by "any CPU"?

(*1)
C:\Program Files\Lockheed Martin\Prepar3D v5 SDK 5.0.21.34709\lib\SimConnect\managed\LockheedMartin.Prepar3D.SimConnect.dll
Regards, Urs
https://www.aivlasoft.com
Highflyer525
Posts: 10
Joined: Wed Feb 07, 2018 8:23 pm

Re: Compiler warning in VS2017

Post by Highflyer525 »

Hi,

What this means is your project is set for either x86 or Any CPU whilst the SimConnect.dll is pure x64.

Go into your project, click compile on the left, and change your target CPU to x64. I think that’s it from memory.

You’ll also need to make sure your target framework under the application tab is .NET 4.8 for it all to play together nicely. From memory you might have to add that one using the bottom option in the framework drop down list for VS2017.

Cheers,

Mark.

P.S. sorry if I’ve misunderstood what you meant, you seem to already be experienced in programming according to your website.
User avatar
Rob McCarthy
Lockheed Martin
Posts: 3703
Joined: Wed Aug 24, 2011 1:37 pm

Re: Compiler warning in VS2017

Post by Rob McCarthy »

Hello,

We updated the core and SDK to Visual Studio 2019 for v5.

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
aivlasoft
Posts: 7
Joined: Mon Apr 02, 2012 7:56 pm

Re: Compiler warning in VS2017

Post by aivlasoft »

Thanks Mark and Rob for your answer.

I never had to change the project settings in the past as long as the settings were set to "any CPU".
What I don't understand is not the "64" it's more the "AMD". So what about all the Intels out there?
Regards, Urs
https://www.aivlasoft.com
Highflyer525
Posts: 10
Joined: Wed Feb 07, 2018 8:23 pm

Re: Compiler warning in VS2017

Post by Highflyer525 »

Hi,

Well the AMD part is a bit of a misnomer. From memory, the only reason x64 is sometimes referred to as AMD64 is because AMD actually invented the 64 bit instruction set and Intel adopted it at a later date.

AMD64 actually just means X64 and is the same for all processors.
aivlasoft
Posts: 7
Joined: Mon Apr 02, 2012 7:56 pm

Re: Compiler warning in VS2017

Post by aivlasoft »

Hi Mark,
thanks for clarification.

I tried to compile with x64 platform but now I'm getting the following warning:

3>------ Rebuild All started: Project: AivlaSoft.SimpleCam.Camera, Configuration: Release x64 ------
2>ALINK : warning AL1073: Referenced assembly 'mscorlib.dll' targets a different processor

So finally I have to learn that with this new SimConnect.dll either configuration/platform results in a warning. Kind of confusing ...
Regards, Urs
https://www.aivlasoft.com
Highflyer525
Posts: 10
Joined: Wed Feb 07, 2018 8:23 pm

Re: Compiler warning in VS2017

Post by Highflyer525 »

That's an odd one, you got me on this.

Having a quick look around it looks like it might be related to a bug in VS2017. https://developercommunity.visualstudio ... assem.html

If you can, you should probably upgrade to VS2019 as Rob suggested, that's what I'm using as well. This should solve the issue, I haven't had it with the recent development I've just done with the latest Simconnect.dll.
aivlasoft
Posts: 7
Joined: Mon Apr 02, 2012 7:56 pm

Re: Compiler warning in VS2017

Post by aivlasoft »

It's not only a bug in VS2017, it's obviously a bug from earlier versions already. I didn't get rid of it even after upgrading to VS2019 because the bug is still there and the warning comes up if the project contains localization satellite assemblies(.resx files). On 'Stackoverflow' some workarounds are provided.
Regards, Urs
https://www.aivlasoft.com
Post Reply