• 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.

SimConnect VS2015

Messages
305
Country
us-california
Hi all,

Slowly getting back into development (Did scenery design a few years ago as Real Scenes) but I am working with SimConnect this time.

I'm not new to C++ or programming (Finishing up a BSEE program right now) but I am far from an expert so please bear with me.

I'm using the P3D v3 SDK provided by Lockheed, but I imagine the basics of setting up a project and getting to compile are the same. As a student I have access to Visual Studio Community 2015 so that is what I'll be using - in the past I used Express 2010 but it's hard to find and I would rather get familiar with the newest tools.

I am trying to get the DataRequest example compiled, in a new solution, and so far I've done the following:

1) Set the Linker command line additional options for SimConnect.lib
2) Added SimConnect under additional dependencies for Linker/Input
3) Added SimConnect Lib and Inc directories under VC++ Directories
4) Added a .DEF file as stated in the SDK manual which includes the DLLSTART, DLLSTOP, etc.
5) Set "Ignore Import Library" to YES according to another post in FSDev.

I am getting the following errors:

-Unresolved external symbol DLLStart
-Unresolved external symbol DLLStop


Not too bad, but I'm sure the errors will continue once those are eradicated. Any ideas on how to proceed?

Thanks for the help!
 
What is your def file? LIBRARY name has to match dll name.

Also - try release rather than debug. I can't get VS2015 to work with dlls in debug. All sorts of external errors.
Also try platform v120 in the General - platform toolset
 
What is your def file? LIBRARY name has to match dll name.

Also - try release rather than debug. I can't get VS2015 to work with dlls in debug. All sorts of external errors.
Also try platform v120 in the General - platform toolset

My def file is just the following:

Code:
LIBRARY "TestPlugin"
EXPORTS
DLLStart
DLLStop

Although, I get the same errors regardless of what is in that file so the build is being stopped before it even gets to that point.

Changing it to release instead of debug did not have any effect, still has the same errors.
I downloaded the v120 toolset (VS2013 I believe?) and installed it, but the option to use the v120 toolset is not available. I opened the provided SDK solution for all the example projects and it hast v120 selected but says "(not installed)" next to it.

Do you know of a good source to download the v120 toolset? Maybe I installed the wrong thing. I'm thinking that switching to the v120 toolset will fix the errors too.
Edit: This is what I downloaded -
https://www.microsoft.com/en-us/download/details.aspx?id=40760

Thanks!
 
Last edited:
Alright, downloaded the full VS2013 suite. I now have the option to build with v120. This seems to have eliminated the externals, but it now is spitting out:
"Cannot open source file 'simconnect.lib'. No such file or directory."

Checked all of my include and library paths, should be good. Added 'simconnect.lib' to the command line as well. Not sure why it is not able to find it. Might be worth nothing that I added it to both the C++/C command line, and Linker command line. Removing it from the C++ tab results in the external errors to reappear.

Do you have a skeleton project that compiles correctly with VS2013?

Thanks again. Hopefully it's close to compiling correctly now.
 
Last edited:
Did you put the simconnect.lib in the Linker command line only? Not in C++

example code here VS2013 (not just VS2015 platform v120)

VS2015 will not work with P3D and simconnect dlls. There are to many breaking changes. They (Microsoft) do not recommend mixing VS lib files. So P3D simconnect.lib is a VS 2013 lib - you need to use VS2013. (new as of VS2010). I get all the errors too in VS2015

https://msdn.microsoft.com/en-us/library/bb531344.aspx

I wonder if this is part of all the P3D v3.1 compatability problems with add-ons.

From the breaking changes:

C Runtime Library (CRT)
General Changes
Refactored binaries
The CRT Library has been refactored into a two different binaries, a Universal CRT (ucrtbase), which contains most of the standard functionality, and a VC Runtime Library (vcruntime140), which contains the compiler-related functionality, such as exception handling, and intrinsics. If you are using the default project settings, then this change does not impact you since the linker will use the new default libraries automatically. If you have set the project's Linker property Ignore All Default Libraries to Yes or you are using the /NODEFAULTLIB linker option on the command line, then you must update your list of libraries (in the Additional Dependencies property) to include the new, refactored libraries. Replace the old CRT library (libcmt.lib, libcmtd.lib, msvcrt.lib, msvcrtd.lib) with the equivalent refactored libraries. For each of the two refactored libraries, there are static (.lib) and dynamic (.dll) versions, and release (with no suffix) and debug versions (with the "d" suffix). The dynamic versions have an import library that you link with. The two refactored libraries are Universal CRT, specifically ucrtbase.dll or .lib, ucrtbased.dll or .lib, and the VC runtime library, libvcruntime.lib, libvcruntime.dll, libvcruntimed.lib, and libvcruntimed.dll. See CRT Library Features.

I think it's easier to use VS2013
 
Last edited:
I see. I was thinking I could use VS2015 but just use the v120 toolset.

I switched over to VS2013 and loaded the project you sent - it compiles no problem. I then started a new project fresh with VS2013 and mirrored all of the settings from your project; when compiling it, I get stuck at the unresolved external symbols again.

Bizarre! For me anyway. Frustrating not knowing what is going wrong but at least we know that I can get something to compile. I will have to keep scouring over your project to figure out what might be wrong.

Thanks for your time. What sort of development do you do for P3D?
 
I had a bunch of extern errors if I used NODEFAULTLIB in VS2013. Make sure you don't have it set.

Review the P3D SimObject API. They use DLLs there and it gives you a start. Don't need the atlcom (unless you app will be doing COM stuff)

I am mostly in Simconnect, but am working on the PDK (SimObject) lower level stuff now. I am playing around with understanding the ISimobject stuff. COM programming ..... yeach!!:banghead:
 
That sounds like a lot of work to even come to an understanding of the COM programming. Beyond me!

I will take a look more at the SimObject API. Compared my project side by side with yours and still don't see any differences so I'm lost there. Maybe the API will enlighten me.

Thanks for the help!
 
Some new discoveries.

I copied the "Request Data" example code into your working project and once again got the external symbol errors. I saw that the calls (Functions, sorry for loose terms here):
void __stdcall DLLStop(void)
void __stdcall DLLStart(void)

were not included in the sample, but they were in your working code. I copied those calls into the Request Data code and it compiled!

I should have noticed this before. Is there a reason why they don't include those function calls in the sample code? And I am assuming these functions can generally remain the same for all projects with the exception of changing your callback name to match in the DLLStart block.

Thanks!
 
Hi, I too have been following a similar path. I'm very experienced in embedded design and software, but completely out of my depth with PC software, such as Visual Studio applications. I have some serial connected instrument hardware which I've got running with FSUIPC on FS2004, but would like to migrate to FSX with SimConnect and expand functionality. Similarly, I installed the FSX SDK and VS2015, but given the advice here I've now installed VS2013.

Would either of you be willing to share a getting-started project which gives read and write access to instrument variables (I'm starting with NAV radios for simplicity), to help get me started? It might also help others looking to get their foot on the first rung of the ladder in interfacing to FSX.
 
hi,
SimConnect works completely fine with VS 2015
i will tell you what to do in order to make it work
first, you must write DLLStart and DLLStop yourself
flight simulator call these when it wants to initialize or cleanup the Add-on
undefined symbol is a linker error meaning that a function is not exist
second, examples in SimConnect SDK are executables, not dlls, they have an entrypoint: main()
although you can modify them to work as a DLL
instead of main() you must implement DLLStart and DLLStop
rename main to DLLStart without any parameters, and create a function DLLStop and move the clean-up code from main in it
also, it doesnt matter for flight simulator if you build your project as a debug build or as a release build
 
Back
Top