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

Messages
74
Country
ca-ontario
Hi, I am using Visual C++ 2008 express edition and I am making a small program to measure the FPM on landing and then close another program if the FPM is under -1000 FPM by using the Vertical Speed variable and the Sim on ground variable. So far I only added the FPM, but I only started an hour ago :D . Anyway, when I tried to compile to test it, I had the following error:

Code:
1>------ Build started: Project: VSI_2, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>d:\documents and settings\agaguk\my documents\visual studio 2008\projects\vsi_2\vsi_2\simconnect.h(678) : error C2143: syntax error : missing ';' before '+'
1>d:\documents and settings\agaguk\my documents\visual studio 2008\projects\vsi_2\vsi_2\simconnect.h(678) : warning C4229: anachronism used : modifiers on data are ignored
1>Build log was saved at "file://d:\Documents and Settings\Laurent\My documents\Visual Studio 2008\Projects\VSI_2\VSI_2\Debug\BuildLog.htm"
1>VSI_2 - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any ideas?

PS: I will also include a zip file containing all the project files tomorrow, I have to go now... :(
 
Last edited:
Hmm, hard to tell without more information, C++ isn't very nice at giving meaningful error messages.

Simconnect makes heavy use of typedefs, perhaps you are using a name in your code already defined by simconnect, or you have a macro somewhere in your code before your #include that expands to an odd construct in the include file. Your line 678 may be different from mine but it looks to be smack into the function header definitions. I suspect something odd with your GROUPID or DEFINEID as you register your VSI data points with SimConnect but that is purely a guess.

Etienne
 
I'm sorry, I forgot to say I looked at the line 678, and it seems like the word "group" had a "+" in it:
Code:
SIMCONNECTAPI SimConnect_ClearNotificationGrou+p(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID);

When I tried to remove it, it gave me even more errors

I also included my main.cpp file, the simconnect.h file and the vcproj file.
 
Last edited:
I'm sorry, I forgot to say I looked at the line 678, and it seems like the word "group" had a "+" in it:
Code:
SIMCONNECTAPI SimConnect_ClearNotificationGrou+p(HANDLE hSimConnect, SIMCONNECT_NOTIFICATION_GROUP_ID GroupID);

When I tried to remove it, it gave me even more errors

Well the + in the procedure name should certainly not be there. That's some sort of corruption in your copy. Maybe there are others. Remove it, then tackle the other errors. Or go and download a fresh copy of the file.

Pete
 
Well the + in the procedure name should certainly not be there. That's some sort of corruption in your copy. Maybe there are others. Remove it, then tackle the other errors. Or go and download a fresh copy of the file.

Pete

Do you know where I could find a fresh copy? I am still learning in C++, but I get mostly get some LNK2019 errors:

Code:
1>------ Build started: Project: VSI_2, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>main.obj : error LNK2019: unresolved external symbol _SimConnect_RequestDataOnSimObjectType@20 referenced in function "void __stdcall MyDispatchProcRD(struct SIMCONNECT_RECV *,unsigned long,void *)" (?MyDispatchProcRD@@YGXPAUSIMCONNECT_RECV@@KPAX@Z)
1>main.obj : error LNK2019: unresolved external symbol _SimConnect_Close@4 referenced in function "void __cdecl testDataRequest(void)" (?testDataRequest@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol _SimConnect_CallDispatch@12 referenced in function "void __cdecl testDataRequest(void)" (?testDataRequest@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol _SimConnect_SubscribeToSystemEvent@12 referenced in function "void __cdecl testDataRequest(void)" (?testDataRequest@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol _SimConnect_AddToDataDefinition@28 referenced in function "void __cdecl testDataRequest(void)" (?testDataRequest@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol _SimConnect_Open@24 referenced in function "void __cdecl testDataRequest(void)" (?testDataRequest@@YAXXZ)
1>D:\Documents and Settings\Agaguk\My documents\Visual Studio 2008\Projects\VSI_2\Debug\VSI_2.exe : fatal error LNK1120: 6 unresolved externals
1>Build log was saved at "file://d:\Documents and Settings\Agaguk\My documents\Visual Studio 2008\Projects\VSI_2\VSI_2\Debug\BuildLog.htm"
1>VSI_2 - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
Last edited:
... but I get mostly get some LNK2019 errors

You have no compilation errors at all now, so you are fine.

The linking errors are simply because you failed to tell the linker to include the simconnect.lib file in its list of libraries to bind to. The linker program doesn't know anything about SimConnect except what you supply. The lib file provides the details it needs to know how to make the linkages.

Pete
 
Back
Top