Author Topic: Problem using wxWidgets on Code::block  (Read 3260 times)

nabito

  • Guest
Problem using wxWidgets on Code::block
« on: May 12, 2008, 03:25:41 pm »
I've strictly followed the tutorial at
http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

After playing around a couple of hours, finally end up with some strange problem. It reports that std lib fn is not declared in buffer.h (wxWidgets include).



-------------- Build: Release in wxWork ---------------

Compiling: wxWorkApp.cpp
In file included from C:/wx/include/wx/string.h:55,
                 from C:/wx/include/wx/log.h:47,
                 from C:/wx/include/wx/msw/private.h:24,
                 from C:/wx/include/wx/msw/wrapcdlg.h:18,
                 from C:/wx/include/wx/wxprec.h:47,
                 from D:\My Documents\codeBlocksWorkspace\wxWork\wxWorkApp.cpp:12:
C:/wx/include/wx/buffer.h: In constructor `wxCharBuffer::wxCharBuffer(const char*)':
C:/wx/include/wx/buffer.h:129: error: `strdup' was not declared in this scope
C:/wx/include/wx/buffer.h:129: warning: unused variable 'strdup'
C:/wx/include/wx/buffer.h: In member function `wxCharBuffer& wxCharBuffer::operator=(const char*)':
C:/wx/include/wx/buffer.h:129: error: `strdup' was not declared in this scope
C:/wx/include/wx/buffer.h:129: warning: unused variable 'strdup'
C:/wx/include/wx/buffer.h: In constructor `wxWCharBuffer::wxWCharBuffer(const wchar_t*)':
C:/wx/include/wx/buffer.h:136: error: `_wcsdup' was not declared in this scope
C:/wx/include/wx/buffer.h:136: warning: unused variable '_wcsdup'
C:/wx/include/wx/buffer.h: In member function `wxWCharBuffer& wxWCharBuffer::operator=(const wchar_t*)':
C:/wx/include/wx/buffer.h:136: error: `_wcsdup' was not declared in this scope
C:/wx/include/wx/buffer.h:136: warning: unused variable '_wcsdup'
In file included from C:/wx/include/wx/log.h:47,
                 from C:/wx/include/wx/msw/private.h:24,
                 from C:/wx/include/wx/msw/wrapcdlg.h:18,
                 from C:/wx/include/wx/wxprec.h:47,
                 from D:\My Documents\codeBlocksWorkspace\wxWork\wxWorkApp.cpp:12:
C:/wx/include/wx/string.h: In function `int Stricmp(const char*, const char*)':
C:/wx/include/wx/string.h:141: error: `strcasecmp' was not declared in this scope
C:/wx/include/wx/string.h:141: warning: unused variable 'strcasecmp'
In file included from C:/wx/include/wx/gdicmn.h:20,
                 from C:/wx/include/wx/msw/private.h:213,
                 from C:/wx/include/wx/msw/wrapcdlg.h:18,
                 from C:/wx/include/wx/wxprec.h:47,
                 from D:\My Documents\codeBlocksWorkspace\wxWork\wxWorkApp.cpp:12:
C:/wx/include/wx/list.h: In constructor `wxListKey::wxListKey(const wxChar*)':
C:/wx/include/wx/list.h:406: error: `_wcsdup' was not declared in this scope
C:/wx/include/wx/list.h:406: warning: unused variable '_wcsdup'
C:/wx/include/wx/list.h: In constructor `wxListKey::wxListKey(const wxString&)':
C:/wx/include/wx/list.h:408: error: `_wcsdup' was not declared in this scope
C:/wx/include/wx/list.h:408: warning: unused variable '_wcsdup'
Process terminated with status 1 (0 minutes, 4 seconds)
7 errors, 7 warnings
 



-------------- Build Messages ---------------


C:\wx\include\wx\buffer.h||In constructor `wxCharBuffer::wxCharBuffer(const char*)':|
C:\wx\include\wx\buffer.h|129|error: `strdup' was not declared in this scope|
C:\wx\include\wx\buffer.h|129|warning: unused variable 'strdup'|
C:\wx\include\wx\buffer.h||In member function `wxCharBuffer& wxCharBuffer::operator=(const char*)':|
C:\wx\include\wx\buffer.h|129|error: `strdup' was not declared in this scope|
C:\wx\include\wx\buffer.h|129|warning: unused variable 'strdup'|
C:\wx\include\wx\buffer.h||In constructor `wxWCharBuffer::wxWCharBuffer(const wchar_t*)':|
C:\wx\include\wx\buffer.h|136|error: `_wcsdup' was not declared in this scope|
C:\wx\include\wx\buffer.h|136|warning: unused variable '_wcsdup'|
C:\wx\include\wx\buffer.h||In member function `wxWCharBuffer& wxWCharBuffer::operator=(const wchar_t*)':|
C:\wx\include\wx\buffer.h|136|error: `_wcsdup' was not declared in this scope|
C:\wx\include\wx\buffer.h|136|warning: unused variable '_wcsdup'|
C:\wx\include\wx\string.h||In function `int Stricmp(const char*, const char*)':|
C:\wx\include\wx\string.h|141|error: `strcasecmp' was not declared in this scope|
C:\wx\include\wx\string.h|141|warning: unused variable 'strcasecmp'|
C:\wx\include\wx\list.h||In constructor `wxListKey::wxListKey(const wxChar*)':|
C:\wx\include\wx\list.h|406|error: `_wcsdup' was not declared in this scope|
C:\wx\include\wx\list.h|406|warning: unused variable '_wcsdup'|
C:\wx\include\wx\list.h||In constructor `wxListKey::wxListKey(const wxString&)':|
C:\wx\include\wx\list.h|408|error: `_wcsdup' was not declared in this scope|
C:\wx\include\wx\list.h|408|warning: unused variable '_wcsdup'|
||=== Build finished: 7 errors, 7 warnings ===|


Note my environment is exact the same as tutorial suggested.

?? Any idea ??

Thanks,

art

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Problem using wxWidgets on Code::block
« Reply #1 on: May 12, 2008, 05:39:57 pm »
I haven't used wxWidgets on win32 in a while, but it's probable that you don't have your include paths set up correctly. Perhaps the headers try to include the stdlib h files and can't find them. Ergo, the declarations aren't made and you end up with all these errors.

Try searching for the file that declares strdup and check in your project's compile options if the include directory is indeed set up.