Witam, przy próbie kompilacji programu SDK pojaiwa się taki błąd:
||=== Build: Debug in cascscsaac (compiler: GNU GCC Compiler) ===|
W:\WorkSpace\cascscsaac\main.cpp|14|warning: #pragma once in main file [enabled by default]|
W:\WorkSpace\cascscsaac\main.cpp|53|warning: this decimal constant is unsigned only in ISO C90 [enabled by default]|
W:\WorkSpace\cascscsaac\main.cpp|766|warning: 'x' defined but not used [-Wunused-variable]|
W:\WorkSpace\cascscsaac\main.cpp|775|warning: 'z' defined but not used [-Wunused-variable]|
obj\Debug\main.o||In function `Z16MyDispatchProcTCP15SIMCONNECT_RECVmPv@12':|
W:\WorkSpace\cascscsaac\main.cpp|784|undefined reference to `SimConnect_AddToDataDefinition@28'|
W:\WorkSpace\cascscsaac\main.cpp|786|undefined reference to `SimConnect_RequestDataOnSimObject@36'|
W:\WorkSpace\cascscsaac\main.cpp|788|undefined reference to `SimConnect_SetDataOnSimObject@28'|
p:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\libmingw32.a(main.o):main.c:(.text.startup+0xa7)||undefined reference to `WinMain@16'|
||=== Build failed: 4 error(s), 4 warning(s) (0 minute(s), 0 second(s)) ===|
Tu jest plik .h (definicje są w tym samym pliku): http://www.speedyshare.com/rsEcx/SimConnect.h To jest kod:
int quit = 0;
HANDLE hSimConnect = NULL;
HRESULT hr;
static enum DATA_DEFINE_ID {
DEFINITION3
} x;
struct DataInitposition
{
double Pitch;
} y;
static enum DATA_REQUEST_ID {
REQUEST_PITCH,
} z;
DataInitposition tc;
// Link DEFINITION3 with the SIMCONNECT_DATA_INITPOSITION structure
void CALLBACK MyDispatchProcTC(SIMCONNECT_RECV* pData, DWORD cbData, void *pDataSet)
{
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION3, "PLANE PITCH DEGREES", "Radians",
SIMCONNECT_DATATYPE_INITPOSITION, 0);
hr = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_PITCH, DEFINITION3, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_ONCE);
hr = SimConnect_SetDataOnSimObject(hSimConnect, DEFINITION3, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(tc), &tc);
}