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

FSX Missing Dependencies

Messages
41
Country
us-virginia
I have a .dll project (written in C++) which uses SimConnect.

All works fine on my machine but when I try to load my project on another machine I get a missing dependencies error when FSX tries to load.

I've created a .def file within my project and if I remove the .def file from the "Properties > Linker > Input > Module Def. File" I get the following error "Cannot find DLLStart" from FSX.

Does anyone know what dependency I'm missing from my project or how I tell the 2nd machine about the DllStart/Stop functions?

Note: I've also set my MFC property to to "Use MFS in a static Dll"

Thanks in Advance...
 
Dear Peety:

Try to install simconnect on the other machine.

In the SDK folder there are simconnect installers.

Alfredo Mendiola Loyola
Lima, Perú
 
Thanks for your post Alfredo.

I ended up uninstalling FSX (incl. all references in the registry) and reinstalled FSX and SP1 and SP2.

Ran my program again and it worked!

Guess there an older reference in the registry that it was pointing too, go figure...

Thanks
 
There could be multiple reasons why the DLL cannot load when you move a simconnect client from one machine to another. The one's I've run into thus far are:

1) different version of the C libraries (FSX was compiled with 8.0) - the current release in VS2008 is 9.0 and that's not always installed on the client PC.

2) different version of simconnect DLLs (RTM, SP1, SP2 and ESP), or no version at all (not installed).

3) different behavior when running in-process (dll) vs out of process (exe), likely because of the load context setup by the loading process. The symptom is the program works great as a standalone, yet cannot find a dependency when running in-process.

The best way I found is to manually scan the side by side folders to ensure what I need to load is in there (in fact, installed or not). Actually, it's also the only way I know to find out what version the client has installed. I then either use the context libraries to load the right side by side dll, or I use the full path to the side by side shared that I found during my scan if the host process interferes with that load. By making the manifest load manual instead of automatic, much better control of what version of simconnect you run is achieved (this means, you create your own manifests as resources, and don't allow simconnect to auto-load the manifest). Also, you don't need the simconnect.lib when you do this. That is a lot of work that should be in theory unnecessary, as it was precisely to avoid these issues that side by side was created. Also, I found that when the full path is used, it works all the time. It's safe to do so if you scan the side by side folders, as they are in a fixed location (%system%\winsxs) and the folder names are in a known format. You can verify the files you need are there, and also load their version information to confirm what is, or is not installed. The registry doesn't really help in this case - raw folder scan seems quick and efficient, and in readonly mode, doesn't get into permissions problems on Vista.

Also, I don't compile my code with MFC as a static library as it bloats my DLL by quite a bit and didn't find it necessary to do so across clients. So long as you redistribute the correct c++ runtime libraries with your add-on (that's a redist package from MS downloadable or you can include it in your setup program, it's also found in the redist folder in your visual studio install), you should be able to do without and keep your footprint small.

Simconnect needs the c++ runtime library 8.0 as well, and that's in the .msi provided with the SDK (Deluxe version only) it looks like. However, the EULA prevents you from redistributing the simconnect client unfortunately so there is no way to ensure the client is configured correctly. That's why I had to ensure it's setup on the machine first as my dll loads. To add insult to injury, FSX doesn't give great error messages as to why the dll didn't load, and neither does the operating system by the way. You have to dig very deep into the side by side fusion logs to see what's going on, or use dependencywalker. Even then it's a mind twister sometimes.

Hope this helps,

Etienne
 
Last edited:
A slight variation on Etienne's point #2, no SimConnect installed, is that there's no managed SimConnect installed only (ie, the main SimConnect.DLL is in the WinSxS but the Microsoft.FlightSimulator.SimConnect.DLL isn't in the Global Assembly Cache). This can occur if you have installed FSX on a WinXP machine that doesn't have any version of .Net installed (no .Net installed, no Global Assembly Cache to install into) and is sometimes the reason why an uninstall/reinstall of FSX fixes the problem (although just rerunning the SimConnect.MSI installer should be sufficient :-> ).

Tim
 
A slight variation on Etienne's point #2, no SimConnect installed, is that there's no managed SimConnect installed only (ie, the main SimConnect.DLL is in the WinSxS but the Microsoft.FlightSimulator.SimConnect.DLL isn't in the Global Assembly Cache). This can occur if you have installed FSX on a WinXP machine that doesn't have any version of .Net installed (no .Net installed, no Global Assembly Cache to install into) and is sometimes the reason why an uninstall/reinstall of FSX fixes the problem (although just rerunning the SimConnect.MSI installer should be sufficient :-> ).

Tim

Dear Tim:

If i program using c++, do i need to have installed the Microsoft.FlightSimulator.SimConnect assembly?

I don't understand why some gauges that are made with c++ use the Microsoft.FlightSimulator.SimConnect assembly?

I thought that i just needed the simconnect.dll to program c++ programs or DLLs (Gauges for example).

Alfredo Mendiola Loyola
Lima, Perú
 
Alfredo,

If I understand your question correctly, the answer is no, you do not need the .NET assembly installed on the client (in most cases, loaded in the GAC) to run your C++ code provided you are not using the CLR (C++ in mixed mode, that is, not using the /clr compiler switch). I should also note that you could run in managed mode, the key is that you do not reference the Simconnect.NET assembly.

The simconnect .NET assembly is only used with managed code, and will be expected to be found in by the CLR's equivalent of the native side by side mechanism, yet is stored in a different folder. The .NET assembly will be located in the GAC (%system%\assembly) folder. It uses .NET's PInvoke/interop marshaling constructs to access the native side-by-side simconnect.dll. The .NET assembly contains a manifest referencing specific versions of the native dll, also expected to be in the side by side folders.

All the problems associated with finding the right version of the native client exist within managed code, plus the additional requirement of having the right version of the .NET assembly installed. The .NET fusion log tool (fuslogw) is simpler to use than the equivalent native winsxs equivalent, and a good article by Suzanne Cook on troubleshooting methods is here: http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx. The native winsxs fusion troubleshooting guide is also well covered here by Junfeng Zhang: http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx


Hope this helps,

Etienne
 
Last edited:
Back
Top