Page 1 of 1

wxHTTPEngine.DevPak don't build with wxdevcpp 4.7.1

Posted: Sun Jan 15, 2012 9:39 pm
by starra
wxHTTPEngine example don't build with wxdevcpp 7.4.1.
in file httpbuilder.h in row 45 i replace

Code: Select all

wxProxySettings() { m_bRequiresAuth = 0; m_bUseProxy = 0; m_nProxyPort = 0; m_strProxyExceptionsDelim = ","; }
with

Code: Select all

wxProxySettings() { m_bRequiresAuth = 0; m_bUseProxy = 0; m_nProxyPort = 0; m_strProxyExceptionsDelim = [b]wxT(",")[/b]; }
in httpengine.dev i have replace -lwxmsw28 -lwxmsw28_gl -lwxregex with -lwxmsw28u -lwxmsw28u_gl -lwxregexu
and add _UNICODE in preprocessor definition.

with this modify if i build the log compile is

Code: Select all

g++.exe "Objects/MingW/httpengineapp.o" "Objects/MingW/httpenginedlg.o" -o "Output/MingW/httpengine.exe" -L"C:/Programmi/Dev-Cpp/Lib" -mwindows -lwxhttpengine -lwxmsw28u -lwxmsw28u_gl -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 -lopengl32   
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilderthread.o):httpbuilderthread.cpp:(.text$_ZN8wxStringaSEPKc[wxString::operator=(char const*)]+0x14): undefined reference to `wxStringBase::operator=(char const*)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text+0xf8d): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text+0xfd4): undefined reference to `operator+(char const*, wxString const&)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text+0x1001): undefined reference to `operator+(wxString const&, char const*)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text+0x103e): undefined reference to `wxString::Replace(char const*, char const*, bool)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text+0x1118): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text+0x1152): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text+0x11b7): undefined reference to `wxString::Printf(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x25): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(hyperlinkctrl.o):hyperlinkctrl.cpp:(.text$_ZN12wxStringBase10ConcatSelfEjPKc[wxStringBase::ConcatSelf(unsigned int, char const*)]+0x22): undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x1292): undefined reference to `wxFile::Open(char const*, wxFile::OpenMode, int)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x194c): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x23c3): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x2464): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x26b4): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x2755): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x2ca1): undefined reference to `wxString::Printf(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x3aeb): undefined reference to `wxString::Replace(char const*, char const*, bool)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x3f93): undefined reference to `wxString::Printf(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x3fb8): undefined reference to `wxString::Printf(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x49cd): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x4fdd): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5189): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5466): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x55a6): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5769): more undefined references to `wxString::Format(char const*, ...)' follow
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5dde): undefined reference to `wxString::Replace(char const*, char const*, bool)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5e07): undefined reference to `wxString::Replace(char const*, char const*, bool)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5e37): undefined reference to `wxString::Replace(char const*, char const*, bool)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5e61): undefined reference to `wxString::Replace(char const*, char const*, bool)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5e84): undefined reference to `wxString::Replace(char const*, char const*, bool)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5f69): undefined reference to `wxString::Find(char, bool) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5fb2): undefined reference to `wxString::Find(char, bool) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x5ffb): undefined reference to `wxString::Find(char, bool) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x6044): undefined reference to `wxString::Find(char, bool) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x608d): undefined reference to `wxString::Find(char, bool) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x60d6): more undefined references to `wxString::Find(char, bool) const' follow
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x6c5d): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x6d2c): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x6e9c): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x716d): undefined reference to `wxArrayString::Index(char const*, bool, bool) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x727a): undefined reference to `wxArrayString::Index(char const*, bool, bool) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x7e85): undefined reference to `wxString::Format(char const*, ...)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x85f9): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text+0x86d8): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text$_ZN8wxStringC1Ecj[wxString::wxString(char, unsigned int)]+0x22): undefined reference to `wxStringBase::wxStringBase(unsigned int, char)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text$_ZNK8wxString8ContainsERKS_[wxString::Contains(wxString const&) const]+0x1c): undefined reference to `wxString::Find(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text$_ZN8wxString6appendEjc[wxString::append(unsigned int, char)]+0x22): undefined reference to `wxStringBase::append(unsigned int, char)'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(httpbuilder.o):httpbuilder.cpp:(.text$_ZeqRK8wxStringPKc[operator==(wxString const&, char const*)]+0x14): undefined reference to `wxString::Cmp(char const*) const'
C:/Programmi/Dev-Cpp/Lib/libwxhttpengine.a(proxysettingsdlg.o):proxysettingsdlg.cpp:(.text+0x56cc): undefined reference to `wxString::Format(char const*, ...)'
collect2: ld returned 1 exit status
mingw32-make.exe: *** [Output/MingW/httpengine.exe] Error 1
Execution terminated
Compilation Failed. Make returned 2

Re: wxHTTPEngine.DevPak don't build with wxdevcpp 4.7.1

Posted: Sun Jan 15, 2012 11:10 pm
by tbreina
It looks like the wxHTTPEngine DevPak wasn't built with Unicode support. So simply adding the _UNICODE flag and using the wxT() wrapper isn't enough (although that's needed too).

You need to download the actual source code for wxHTTPEngine and create your own wxhttpengine.a (I think the makefile will probably call it wxhttpengineu.a). It's a bit tricky, but definitely a good learning experience.

To start, you'll need to download the wxWidgets source (http://sourceforge.net/projects/wxwindo ... urce=files). Then, from the Windows command line you'll need to change the directory to c:\wxWIdgets-2.8.12\build\msw.

Now type the following 2 commands:

Code: Select all

set path=C:\Progra~1\dev-cpp\bin;%path%
mingw32-make -f makefile.gcc UNICODE=1 MONOLITHIC=1 BUILD=release
This assumes that your wxDev-C++ is installed in c:\Program Files\dev-cpp. The build will take about 30-60 minutes so have your favorite beverage handy.

Now download the wxhttpengine.zip file and unzip it (http://sourceforge.net/projects/wxcode/ ... p/download).

Then from the Windows command line change the directory to the wxhttpengine/build directory. Then, type the following two commands:

Code: Select all

set path=C:\Progra~1\dev-cpp\bin;%path%
mingw32-make -f makefile.gcc UNICODE=1 MONOLITHIC=1 BUILD=release
Then copy the compiled library from wxhttpengine\lib into your c:\Program Files\Dev-Cpp\lib directory.

That file should have unicode support and will correctly link.

-Tony

Re: wxHTTPEngine.DevPak don't build with wxdevcpp 4.7.1

Posted: Mon Jan 16, 2012 9:16 am
by starra
ok with the new library with unicode support linking correctly.
There is a problem in component.
Tn example exe don't load a page of url select.
Is possible that is a unicode problem of url passed?
For build wxhttpengineu.a i have replate "" string with wxT("")

Re: wxHTTPEngine.DevPak don't build with wxdevcpp 4.7.1

Posted: Mon Jan 16, 2012 5:54 pm
by tbreina
starra wrote:ok with the new library with unicode support linking correctly.
There is a problem in component.
Tn example exe don't load a page of url select.
Is possible that is a unicode problem of url passed?
For build wxhttpengineu.a i have replate "" string with wxT("")
I'm not sure url's can handle Unicode strings. However, you might want to post this question on the C++ developer's section of this forum. They are more knowledgeable about such things.

-Tony