User forums > Help

problems compiling default wxWidgets application

<< < (2/3) > >>

takeshimiya:
Or here http://wiki.wxwidgets.org/wiki.pl?CodeBlocks_Setup_Guide  :)

pivica:
Hi all,


--- Quote ---Or here http://wiki.wxwidgets.org/wiki.pl?CodeBlocks_Setup_Guide 
--- End quote ---

ok, the guide says (I am using cygwin for compilation)
   cd %WXWIN%\build\msw
   make -f makefile.gcc clean

and I get bunch of error like


--- Code: ---ivica@none-vzk04m85es /cygdrive/c/wx/wxWidgets/2.6.0/build/msw
$ make -f makefile.gcc clean
if exist gcc_mswd\*.o del gcc_mswd\*.o
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: [clean] Error 2 (ignored)
if exist ..\..\lib\gcc_lib\libwxregexd.a del ..\..\lib\gcc_lib\libwxregexd.a
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: [clean] Error 2 (ignored)
if exist ..\..\lib\gcc_lib\libwxzlibd.a del ..\..\lib\gcc_lib\libwxzlibd.a
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: [clean] Error 2 (ignored)
if exist ..\..\lib\gcc_lib\libwxpngd.a del ..\..\lib\gcc_lib\libwxpngd.a
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: [clean] Error 2 (ignored)
if exist ..\..\lib\gcc_lib\libwxjpegd.a del ..\..\lib\gcc_lib\libwxjpegd.a
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: [clean] Error 2 (ignored)
....
--- End code ---

Never mind, I clean all libs by hand from previous compilation. Then goes next command

   make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1    BUILD=release UNICODE=0 VENDOR=cb

end I get next output


--- Code: ---ivica@none-vzk04m85es /cygdrive/c/wx/wxWidgets/2.6.0/build/msw
$ make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0
VENDOR=cb
if not exist gcc_mswdll mkdir gcc_mswdll
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: [gcc_mswdll] Error 2 (ignored)
if not exist ..\..\lib\gcc_dll mkdir ..\..\lib\gcc_dll
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [..\..\lib\gcc_dll] Error 2
--- End code ---

what now? Seems that my bash shell from cygwin don't understand default makefile from wxWidgets.


--- Quote ---However, I have already recommended you to compile wxWidgets from the makefiles and not from C::B, you should try.
--- End quote ---

I never try to compile wxWidgets from C::B. I compiled wxWidgets 2.6.0 with MS Visual Studio 7.1 and also with cygwin. With MS I didn't have any problem, but with cygwin I had. The default makefile that ships with wxWidgets wont work with my bash shell from cygwin, see above. But it worked with combination (this is from INSTALL-MSW.txt from wxWidgets)

   $../configure --with-msw --enable-debug --enable-debug_gdb –disable-shared
   $make

 Then I compiled minimal sample from sample dir of wxWidgets and it worked, I have got windows with to menu button. So everything went ok.
Then I made default wxWidgets application in C::B, I have set include directories for GCC compiler like

   C:\wx\wxWidgets\2.6.0\include
   C:\wx\wxWidgets\2.6.0\lib\gcc_lib\mswd

added link dir

   C:\wx\wxWidgets\2.6.0\lib\gcc_lib

and added link libraries

   libwx_based-2.6
   libwx_core-2.6

and get errors from my previous post.

Well inspired;) with text from http://wiki.wxwidgets.org/wiki.pl?CodeBlocks_Setup_Guide I tried next, from mine cygwin:

$ ../configure --with-msw --enable-xrc --enable-shared --enable-monolithic --en
able-vendor=CB

I didn't find switch for disabling debug, well...
Next I did $make and I've get next libs

   libwxjpegd-2.6.a
   libwxpngd-2.6.a
   libwxtiffd-2.6.a
   libwx_mswd-2.6.dll.a
   libwx_mswd_stc-2.6.dll.a (yes, I've also compiled stc)
   wxmsw26d_gcc_cb.dll
   wxmsw26d_stc_gcc_cb.dll

I opened C::B, started a new wxWidgets project, with project options – Using wxWidgets DLL. Compiled and linked, and surprise, everything went ok except 4 warnings


--- Code: ---Project   : wxWidgets application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\TEMP\wxWidgets3\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from C:/wx/wxWidgets/2.6.0/include/wx/wxchar.h:152,
                 from C:/wx/wxWidgets/2.6.0/include/wx/debug.h:22,
                 from C:/wx/wxWidgets/2.6.0/include/wx/defs.h:450,
                 from C:/wx/wxWidgets/2.6.0/include/wx/wxprec.h:13,
                 from app.h:4,
                 from main.h:4,
                 from main.cpp:1:
C:/Program Files/CodeBlocks/include/tchar.h:274:1: warning: "_puttchar" redefined
In file included from C:/wx/wxWidgets/2.6.0/include/wx/platform.h:545,
                 from C:/wx/wxWidgets/2.6.0/include/wx/defs.h:21,
                 from C:/wx/wxWidgets/2.6.0/include/wx/wxprec.h:13,
                 from app.h:4,
                 from main.h:4,
                 from main.cpp:1:
C:/wx/wxWidgets/2.6.0/include/wx/msw/gccpriv.h:108:1: warning: this is the location of the previous definition
Compiling: app.cpp
In file included from C:/wx/wxWidgets/2.6.0/include/wx/wxchar.h:152,
                 from C:/wx/wxWidgets/2.6.0/include/wx/debug.h:22,
                 from C:/wx/wxWidgets/2.6.0/include/wx/defs.h:450,
                 from C:/wx/wxWidgets/2.6.0/include/wx/wxprec.h:13,
                 from app.h:4,
                 from app.cpp:1:
C:/Program Files/CodeBlocks/include/tchar.h:274:1: warning: "_puttchar" redefined
In file included from C:/wx/wxWidgets/2.6.0/include/wx/platform.h:545,
                 from C:/wx/wxWidgets/2.6.0/include/wx/defs.h:21,
                 from C:/wx/wxWidgets/2.6.0/include/wx/wxprec.h:13,
                 from app.h:4,
                 from app.cpp:1:
C:/wx/wxWidgets/2.6.0/include/wx/msw/gccpriv.h:108:1: warning: this is the location of the previous definition
Linking executable: C:\TEMP\wxWidgets3\wxWidgets.exe
Process terminated with status 0 (0 minutes, 21 seconds)
0 errors, 4 warnings
--- End code ---


What a hell, I can live with that:))
So I hit run and my application complained about 4 missing dll's:
wxmsw26d_gcc_cb.dll
cygwin1.dll
cygexpat-0.dll
cygz.dll

I've copied those dll's to dir where my wxWidgets application is, and hit run again. This time a windows pop up saying “wxWidgets.exe has encountered a problem and needs to close.  We are sorry for the inconvenience.“

Really no ideas, what to do next.

tiwag:

--- Quote from: pivica on August 05, 2005, 01:09:20 pm ---
--- Quote ---Or here http://wiki.wxwidgets.org/wiki.pl?CodeBlocks_Setup_Guide 
--- End quote ---
ok, the guide says...
--- End quote ---

what the guide doesn't say is that it is written for
MinGW32-gcc (version 3.4.4)
and
Mingw32-make (version 3.80)

which you can download with CodeBlocks from here
http://prdownloads.sourceforge.net/codeblocks/codeblocks-1.0-rc1_mingw.exe?download

then it works  8)

takeshimiya:
True, I forgot to write that the guide is for MINGW, not CYGWIN nor MSYS.

pivica:
Well this time I almost did it;)
I manage finally to compile wxWidgets. Guide suggested also compilation of C::B, but I try to skip that and from previous installation of C::B I created new wxWidget application and successfully compiled and linked program. But when I try to run it I get next fatal error:

   Mismatch between the program and library build version detected,
   The library used 2.6 (no debug, ANSI, compiler with C++ ABI 102, wx containers, compatible with 2.4), and your program used 2.6 (no debug, ANSI, compiler with C++ ABI 1002, wx containers, compatible with 2.4).

Then I compiled C::B, like guide suggested (with wxWidgets 2.6.0). From my C::B I opened CodeBlocks-wx2.6.0.cbp, set include and libs. wxDockIt didn't compile because it dose not exist, but everything else compiled with success. I've run newly compiled C::B and get the same fatal error. I erased plugins and compiled again (README-wx2.6.0 suggest this when C::B crash), but I've got the same error.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version