# Linker Errors (wxWidgets and windows.h)

This topic is 3472 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. I've got a problem with my project. I get the following link error in VS2008
main.obj : error LNK2019: unresolved external symbol "public: __thiscall PSystemManager::PSystemManager(struct HWND__ *)" (??0PSystemManager@@QAE@PAUHWND__@@@Z) referenced in function "public: virtual bool __thiscall MyApp::OnInit(void)" (?OnInit@MyApp@@UAE_NXZ)
main.cpp is for example this:
#include "./PSystemManager.h"
void function(){
PSystemManager* ps = new PSystemManager(pgui->getDrawArea());
}
PSystemManager is a class I made and has this constructor [inlinecode]PSystemManager(HWND wind);[/inlinecode] which is defined in PSystemManager.cpp file(which includes PSystemManager.h) They both include <windows.h> for HWND. If I call the empty constructor of my class I get no linker error, so it has to do with HWND. Any idea why I'm getting this error? Then I'm also getting this error
ParticleGUI.obj : error LNK2019: unresolved external symbol "public: __thiscall wxGLCanvas::wxGLCanvas(class wxWindow *,int,int *,class wxPoint const &,class wxSize const &,long,class wxString const &,class wxPalette const &)" (??0wxGLCanvas@@QAE@PAVwxWindow@@HPAHABVwxPoint@@ABVwxSize@@JABVwxString@@ABVwxPalette@@@Z) referenced in function "public: __thiscall ParticleGUI::ParticleGUI(class wxString const &,class wxSize)" (??0ParticleGUI@@QAE@ABVwxString@@VwxSize@@@Z)

I am including <wx/glcanvas.h> in that function. BUT to make it compile I had to change 4 header files of wxWidgets in its /include/ folder. To enable wxGLCanvas I had to set in the setup.h files wxUSE_GLCANVAS to 1. And also had to correct a mistake in glcanvas.h file which had #if wxUSE_GLCANVAS instead of #ifdef wxUSE_GLCANVAS. Then it finally compiled but I'm getting this linker error. Someone told me that perhaps I have to recompile all the .lib's of wxWidgets now that I changed their header files,and that this might be what's causing this, but I got no idea how to do this Any help appreciated

• 10
• 17
• 9
• 14
• 41