开发者

wxWidgets: undefined reference to wxURL

开发者 https://www.devze.com 2023-03-04 22:52 出处:网络
When I create a wxURL object I get an undefined refe开发者_StackOverflow中文版rence error: #include <wx/url.h>

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消