When I create a wxURL object I get an undefined refe开发者_StackOverflow中文版rence error:
#include <wx/url.h>
....
wxURL url(L"http://site.com/file.txt");
)]+0x8d)||undefined reference to `wxURL::wxURL(wxString const&)'|
)]+0xba)||undefined reference to `wxURL::~wxURL()'|
)]+0x15e)||undefined reference to `wxURL::~wxURL()'|
Why might that be?
When you compile your code, are you linking the corresponding .cpp
files / libraries (related to wxURL
) also ? That's essential, because your errors are link time.
I solved it by linking to the wxNet library.
In CodeBlocks cbp file:
<Linker>
....
<Add library="libwxbase29u_net.a" />
....
</Linker>
精彩评论