pb to build a basic c++ sample.

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
bokdany
Posts: 25
Joined: Thu Apr 09, 2015 9:15 am

pb to build a basic c++ sample.

Post by bokdany »

Hi, I just woul'd like to test a basic simconnect c++ sample "Change Vehicle" but when I try to build the project I obtain the following errors:

LNK2019 symbole externe non résolu "__declspec(dllimport) public: __thiscall std::exception::exception(char const * const &)" (__imp_??0exception@std@@QAE@ABQBD@Z) référencé dans la fonction "public: __thiscall std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAE@PBD@Z) lvartest1 c:\Users\dany\documents\visual studio 2015\Projects\LVAR_TEST_xx\lvartest1\SimConnect.lib(commClient.obj)

LNK2019 symbole externe non résolu __imp___vsnprintf référencé dans la fonction "long __stdcall StringVPrintfWorkerA(char *,unsigned int,unsigned int *,char const *,char *)" (?StringVPrintfWorkerA@@YGJPADIPAIPBD0@Z) lvartest1 c:\Users\dany\documents\visual studio 2015\Projects\LVAR_TEST_xx\lvartest1\SimConnect.lib(commClient.obj)

LNK2019 symbole externe non résolu __imp__printf référencé dans la fonction "public: virtual void __thiscall CClient::Reset(void)" (?Reset@CClient@@UAEXXZ) lvartest1 c:\Users\dany\documents\visual studio 2015\Projects\LVAR_TEST_xx\lvartest1\SimConnect.lib(client.obj)

LNK1120 3 externes non résolusGravité Code Description Projet Fichier Ligne État de la suppression
Erreur LNK1120 3 externes non résolus lvartest1 c:\users\dany\documents\visual studio 2015\Projects\LVAR_TEST_xx\Debug\lvartest1.dll 1

The C++ sample "Change vehicle":

#include <Windows.h>
#include <tchar.h>
#include <stdio.h>
#include "C:\Users\dany\Documents\Visual Studio 2015\Projects\Prepar3D v2 SDK 2.5.12946.0\Utilities\SimConnect SDK\Inc\SimConnect.h"
#include <strsafe.h>

HANDLE hSimConnect = NULL;

void ChangeVehicle()
{
HRESULT hr;

if (SUCCEEDED(SimConnect_Open(&hSimConnect, "Change Vehicle", NULL, 0, 0, 0)))
{
// Sending the title of the vehicle
SimConnect_ChangeVehicle(hSimConnect, "Maule M7 260C paint2");

hr = SimConnect_Close(hSimConnect);
}
}

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

return 0;
}

I have follow all the steps explained in the sdk to configure VS2015 for project in C++ and I don't understand why it doesn't work ? someone can help me, thank in advance ?
Locked