• 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 Error LNK1104 - exe file not found

Messages
51
Country
denmark
I would like to try an example from the SimConnect SDK:

// SimConnect_Test.cpp : Defines the entry point for the console application.
//

//------------------------------------------------------------------------------
//
// SimConnect Open and Close Sample
//
// Description:
// Opens and immediately Closes SimConnect
//------------------------------------------------------------------------------

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <strsafe.h>
#include "SimConnect.h"

HANDLE hSimConnect = NULL;

void testOpenClose()
{
HRESULT hr;

if (SUCCEEDED(SimConnect_Open(&hSimConnect, "Open and Close", NULL, 0, 0, 0)))
{
printf("\nConnected to Flight Simulator!");

hr = SimConnect_Close(hSimConnect);

printf("\nDisconnected from Flight Simulator");
}
else
{
printf("\nFailed to connect to Flight Simulator");
}
}

int __cdecl _tmain(int argc, _TCHAR* argv[])
{
testOpenClose();

return 0;
}


But I get this error when I try to compile and build the code in Visual Studio Express 2013 (VSE 2013):

The pop-up error message:
Unable to start program 'C:\Users\Bruger\Documents\Visual Studio 2013\Projects\SimConnect_Test\Debug\SimConnect_Test.exe',
The mentioned file was not found.

And the Error List in VSE 2013:
error LNK1104: cannot open file 'F\Program.obj'

I Wonder what is the problem here?? Really hope someone can help!

Best regards
Lars
 
This is not a problem with simconnect, rather with compiler - you should be able to google the error and find some infos.
 
It works for me using Visual C++ 2010.

I double-clicked Open and Close.vcproj and let Visual C++ convert it. It then runs, briefly displaying a console window to prove it.

Which compiler are you using?
 
Last edited:
I am using Visual Studio Express 2013. Maybe I should try C++ Visual 2010. Is this a free compiler??

Best Regards
Lars
 
Last edited:
I am using Visual Studio Express 2013. Maybe I should try C++ Visual 2010. Is this a free compiler??

Best Regards
Lars

Shouldn't really make a difference. VSE 2013 is just the latest version of Visual Studio and VS2010 an earlier one.

Check the Debug Folder in your project - is an executable created?

Googling the error message as suggested above generates a lot of links including this one: http://social.msdn.microsoft.com/Fo...annot-open-file-cprogramobj?forum=Vsexpressvc
 
Last edited:
It runs in Visual C++ 2012 for me. In this case I had to open Visual C++ 2012 then open the project Open and Close.vcproj and let Visual C++ 2012 irreversibly convert it.

Have you copied the Open and Close.vcproj and OpenClose.cpp files to another location? If so, it won't run. Microsoft has a tricky habit of including relative paths in the vcproj files. This ensures that files referenced that way may not be found after the move!
 
Last edited:
I copy the Open and Close folder from SDK Samples to the VSE 2013 Projects folder. Open and convert it as a one-way upgrade = irreversibly. I have some warnings on a log but they donot seem so serious!

Then I debug and build by clicking the green arrow) and I first informed like this: "There were build errors. Would you like to continue and run the last successful build?"
When Continuing by clicking [Yes] I get an errormessage with this text:
"Unable to start program 'C:\Users\Bruger\Documents\Visual Studio 2013\Projects\Open and Close\Open ans Close\Debug\Open and Close.exe'.
The mentioned file was not found


Removing this errormessage with [OK] I find in the error List beneath the editor this error: "errorLNK1104: cannot open file '../../../lib/SimConnect.lib'"

So my conclusion is that somehow the VSE 2013 Compiler is not able to find the SimConnect.lib file and that is why the exe file is not build.
I have placed the SimConnect.lib file in the VSE 2013 folder for that pupose: "F:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib"

Do I have to edit a property in the VSE 2013 compiler in order to make it find the SimConnect.lib file?
Any other suggestions? :confused:
 
Last edited:
"RTFM" :o

Reading the SimConnect SDK Reference about the SetUp for C++ Projects the text is clear

Link to the SimConnect.lib library, by adding SimConnect.lib to the Additional Options of the Command Line . - and with an image to clear Things out!
Now it seems to function and the "Open and Close.exe" file is created :)

Thank you for all your help. Your answers have been the gasoline which made my old Beaver continue over the wilderness of unknown land to the safe airport of knowledge.... :scratchch
 
I'm pleased you've got it to run.

the problem is that Open and Close.vcproj contains the line

Code:
AdditionalOptions="../../../lib/SimConnect.lib"

This directs it to look for Simconnect.lib in a folder called lib 3 levels up from the source folder. That only works as long as the source is in the original SDK folder.

My solution was to delete that line, copy SimConnect.lib into a folder in my Visual C++ folder, and then manually add it using Project|Add existing item.
 
I had the same problem but I solved it. Now I'm getting Visual Studio C# because I know C# the most but I cannot find any SimConnect tutorial anywhere. I want to make a simple Fuel Calculator and I need to get some data from the current user aircraft, etc. I can also use Unity Game Engine, I can make the whole logic and GUI with it but I need to know the distance between departure and arrival airports and also some data from the current aircraft.cfg.
 
Last edited:
I had the same problem but I solved it. Now I'm getting Visual Studio C# because I know C# the most but I cannot find any SimConnect tutorial anywhere. I want to make a simple Fuel Calculator and I need to get some data from the current user aircraft, etc. I can also use Unity Game Engine, I can make the whole logic and GUI with it but I need to know the distance between departure and arrival airports and also some data from the current aircraft.cfg.

In SDK, there's few C# samples which are pretty good. Also in the SDK Help there is few point regarding managed code.

Regarding reading aircraft.cfg of currently loaded airplane, look to the end of this thread - Framac attached nice code snippet:

http://www.prepar3d.com/forum-5/?mingleforumaction=viewtopic&t=3182
 
Back
Top