Compiler warning in VS2017

aivlasoft
Posts: 7
Joined: Mon Apr 02, 2012 7:56 pm

Compiler warning in VS2017

Postby aivlasoft » Tue Apr 21, 2020 2:39 pm

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: 9
Joined: Wed Feb 07, 2018 8:23 pm

Re: Compiler warning in VS2017

Postby Highflyer525 » Tue Apr 21, 2020 3:09 pm

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: 2878
Joined: Wed Aug 24, 2011 1:37 pm

Re: Compiler warning in VS2017

Postby Rob McCarthy » Tue Apr 21, 2020 3:14 pm

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

Postby aivlasoft » Tue Apr 21, 2020 4:24 pm

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: 9
Joined: Wed Feb 07, 2018 8:23 pm

Re: Compiler warning in VS2017

Postby Highflyer525 » Tue Apr 21, 2020 7:04 pm

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

Postby aivlasoft » Wed Apr 22, 2020 9:03 am

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: 9
Joined: Wed Feb 07, 2018 8:23 pm

Re: Compiler warning in VS2017

Postby Highflyer525 » Wed Apr 22, 2020 12:43 pm

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

Postby aivlasoft » Fri Apr 24, 2020 12:48 pm

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


Return to “SimConnect Interface Questions”

Who is online

Users browsing this forum: No registered users and 14 guests