Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question#include <windows.h> #include <stdio.h> #include #include "Simulator.h" Simulator::Simulator() { } Simulator::~Simulator() { } unsigned int __stdcall Simulator::SimProc(LPVOID) { HWND hwnd; MessageBox(hwnd,"thread","essai",MB_OK); } void Simulator::startsim() { hThread = (HANDLE) _beginthreadex ( NULL , 0 , &SimProc , NULL , 0 , &threadID ) ; }
class Simulator { public: unsigned int __stdcall SimProc (LPVOID); Simulator(); virtual ~Simulator(); HANDLE hThread; HANDLE hEvent; unsigned int threadID; void startsim(); };
Simulator.obj : error LNK2001: unresolved external symbol "public: static unsigned int __stdcall Simulator::SimProc(void *)" (?SimProc@Simulator@@SGIPAX@Z) LIBCMTD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/essai thread2.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. essai thread2.exe - 3 error(s), 0 warning(s)
#include "../Display/DDraw_Class.h" #include "../Display/Display.h" #include "Data_Info.h" #include "Mode.h" class Simulator { public: char szPath[260]; static double speedInMetersByPeriod; static double steeringAngleInRad; static void endThread(HANDLE hThread,HANDLE hEvent, DWORD threadID); static HINSTANCE TheInstance ; static HANDLE hThread_main; static HANDLE hEvent_main; static UINT threadID_main; private: HWND hdlgdem; static HWND hwnd; static DD_OBJ dd_obj; static Data_Info informations; static Display window; static Mode mode; Simulator(); virtual ~Simulator(); static char * background_path; static char * odopix_path; void startsim(); static unsigned int WINAPI Sim_Thread_Proc( LPVOID ); static int startThread ( HANDLE , HANDLE , DWORD ); static DWORD CALLBACK Thread_Draw_Proc( LPVOID ); static LRESULT CALLBACK Loader (HWND hdlgdem, UINT msg, WPARAM wParam, LPARAM lParam); static BOOL CALLBACK Main_Window_Proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK Draw_Window_Proc(HWND, UINT, WPARAM, LPARAM); static double checkSteeringAngle(double angle); static double drivenDistance; static double cumulDrivenDistance; static double speedInMetersBySecond; static double position_x,position_y,position_theta; };
simcab.obj : error LNK2001: unresolved external symbol "public: static double Simulator::steeringAngleInRad" (?steeringAngleInRad@Simulator@@2NA) Simulator.obj : error LNK2001: unresolved external symbol "public: static double Simulator::steeringAngleInRad" (?steeringAngleInRad@Simulator@@2NA) simcab.obj : error LNK2001: unresolved external symbol "public: static double Simulator::speedInMetersByPeriod" (?speedInMetersByPeriod@Simulator@@2NA) Simulator.obj : error LNK2001: unresolved external symbol "public: static double Simulator::speedInMetersByPeriod" (?speedInMetersByPeriod@Simulator@@2NA) Simulator.obj : error LNK2001: unresolved external symbol "public: static struct HINSTANCE__ * Simulator::TheInstance" (?TheInstance@Simulator@@2PAUHINSTANCE__@@A) Simulator.obj : error LNK2001: unresolved external symbol "public: static void * Simulator::hThread_main" (?hThread_main@Simulator@@2PAXA)