Author Topic: problems compiling default wxWidgets application  (Read 27161 times)

pivica

  • Guest
problems compiling default wxWidgets application
« on: August 02, 2005, 04:00:57 pm »
Hello everybody,

First of all thanks for codebloks, its really looking promising, but problems never ends :)
I have trouble compiling default wxWidgets application which i get from new project-> wxWidgets application.
I added include and lib directories from wxWidgets 2.6.0 for compiler and linker in build options.

When i try to compile whit MS Free Toolkit 2003 (i added Platform SDK and corresponding directories for include and lib), compilation went smoothly but linker complaint that he can't found ctl3d32.lib. I try to erase that lib from codebloks build option and than linker couldn't find MSVCRTD.lib; i added that lib from ms visual studio 2003 to lib directories from MS Free Toolkit and than i got many of already defined link errors.

I also tried with GCC and i get next error from compiler
Code
Project   : wxWidgets application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\TEMP\wxWidgets1\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from C:/wx/wxWidgets/2.6.0/include/wx/platform.h:260,
                 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/msvc/wx/setup.h:111:6: #error "This file should only be included when using Microsoft Visual C++"

Version of codebloks is 1.0-RC1

Can anyone help me?

Offline Funto

  • Multiple posting newcomer
  • *
  • Posts: 81
Re: problems compiling default wxWidgets application
« Reply #1 on: August 02, 2005, 04:11:50 pm »
Quote
C:/wx/wxWidgets/2.6.0/include/msvc/wx/setup.h:111:6: #error "This file should only be included when using Microsoft Visual C++"
There should be another setup.h avalaible for MinGW somewhere in your wxWidgets install I think...

You could also, either compile wxWidgets by yourself with MinGW/MSYS, or use a DevPak.

zieQ

  • Guest
Re: problems compiling default wxWidgets application
« Reply #2 on: August 02, 2005, 04:47:26 pm »
Yes, you included the wrong header.
mine is here: wxWidgets-2.6.1\lib\gcc_dll\msw\wx

I compiled wxWidgets from the makefiles with MSVC Toolkit and MinGW with no problem, but you must carefully set the make options of wxWidgets to compile with MSVC Toolkit since it lacks some libraries. Compile only Release versions and you should not have any problem.

To compile with MSVC from C::B without MSVCRTD.lib, you must change the runtime libraries option in the build settings, but it will be a pain. Some advice as above, only release version. Don't know how to cope with the missing libraries of the Toolkit! I proposed an auto-detection of the missing libraries to disable some of the runtime library options but it is not implemented for now. If you have the libraries from Visual Studio it should work anyway. Could you please give the link errors you obtain?

pivica

  • Guest
Re: problems compiling default wxWidgets application
« Reply #3 on: August 04, 2005, 06:05:50 pm »
GCC

This time I include right header, and compilation went fine but linker stuck. I compiled wxWidgets with MS Visual Studio 7.1, and it cross on my mind that maybe I can't use GCC with wxWidgets libs that was compiled with MSVC. So I downloaded cygwin and compile wxWidgets with it; after little struggle I manage to compile wxWidgets. Back to CodeBloks, changed libs dir, and tried to rebuild all – program was compiled but, again, linking failed. Here is output:

Code
Project   : wxWidgets application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\TEMP\wxWidgets1\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
Compiling: app.cpp
Linking executable: C:\TEMP\wxWidgets1\wxWidgets.exe
.objs\main.o:main.cpp:(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x138): undefined reference to `wxWindow::RegisterHotKey(int, int, int)'
.objs\main.o:main.cpp:(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x13c): undefined reference to `wxWindow::UnregisterHotKey(int)'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_wxchar.o): In function `Z7wxMB2WCPwPKcj':
../../src/common/wxchar.cpp:79: undefined reference to `mbsrtowcs'
../../src/common/wxchar.cpp:86: undefined reference to `mbsrtowcs'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_wxchar.o): In function `Z7wxWC2MBPcPKwj':
../../src/common/wxchar.cpp:106: undefined reference to `wcsrtombs'
../../src/common/wxchar.cpp:113: undefined reference to `wcsrtombs'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_log.o):../../src/common/log.cpp:532: undefined reference to `__getreent'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_log.o):../../src/common/log.cpp:532: undefined reference to `__getreent'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_log.o):../../src/common/log.cpp:551: undefined reference to `__getreent'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_utils.o): In function `Z12wxGetHomeDirP8wxString':
../../src/msw/utils.cpp:395: undefined reference to `cygwin_conv_to_full_win32_path'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_filename.o):../../src/common/filename.cpp:1063: undefined reference to `CoCreateInstance@20'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_filename.o):../../src/common/filename.cpp:1069: undefined reference to `IID_IPersistFile'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_filefn.o): In function `Z21wxGetWorkingDirectoryPci':
../../src/common/filefn.cpp:1459: undefined reference to `cygwin_conv_to_full_win32_path'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_filefn.o): In function `Z13wxGetFileKindi':
../../src/common/filefn.cpp:1928: undefined reference to `get_osfhandle'
C:\wx\wxWidgets\2.6.0\lib\gcc_lib/libwx_based-2.6.a(baselib_msgout.o):../../src/common/msgout.cpp:104: undefined reference to `__getreent'

.......

MSVC Toolkit

Here are link errors I get when copy MSVCRTD.lib from visual studio to toolkit

Code
Project   : wxWidgets application
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\TEMP\wxWidgets1\
--------------------------------------------------------------------------------
Switching to target: default
main.cpp
cl : Command line warning D4002 : ignoring unknown option '-pipe'
cl : Command line warning D4002 : ignoring unknown option '-mthreads'
cl : Command line warning D4002 : ignoring unknown option '-fno-pcc-struct-return'
cl : Command line warning D4002 : ignoring unknown option '-fno-rtti'
cl : Command line warning D4002 : ignoring unknown option '-fno-exceptions'
app.cpp
cl : Command line warning D4002 : ignoring unknown option '-pipe'
cl : Command line warning D4002 : ignoring unknown option '-mthreads'
cl : Command line warning D4002 : ignoring unknown option '-fno-pcc-struct-return'
cl : Command line warning D4002 : ignoring unknown option '-fno-rtti'
cl : Command line warning D4002 : ignoring unknown option '-fno-exceptions'
Linking executable: C:\TEMP\wxWidgets1\wxWidgets.exe
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _malloc already defined in LIBC.lib(malloc.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _realloc already defined in LIBC.lib(realloc.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _memmove already defined in LIBC.lib(memmove.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _free already defined in LIBC.lib(free.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _tolower already defined in LIBC.lib(tolower.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _calloc already defined in LIBC.lib(calloc.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _atoi already defined in LIBC.lib(atox.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _exit already defined in LIBC.lib(crt0dat.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _abort already defined in LIBC.lib(abort.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _strncpy already defined in LIBC.lib(strncpy.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
wxbase26d.lib(appbase.obj) : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "bool __cdecl DoShowAssertDialog(class wxString const &)" (?DoShowAssertDialog@@YA_NABVwxString@@@Z)
wxbase26d.lib(log.obj) : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl wxLogSysErrorHelper(long)" (?wxLogSysErrorHelper@@YAXJ@Z)
wxmsw26d_core.lib(app.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
wxmsw26d_core.lib(msgdlg.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
wxmsw26d_core.lib(evtloop.obj) : error LNK2001: unresolved external symbol __imp__PostMessageA@16
wxbase26d.lib(thread.obj) : error LNK2019: unresolved external symbol __imp__PostMessageA@16 referenced in function "public: enum wxThreadError __thiscall wxThreadInternal::WaitForTerminate(class wxCriticalSection &,void * *,class wxThread *)" (?WaitForTerminate@wxThreadInternal@@QAE?AW4wxThreadError@@AAVwxCriticalSection@@PAPAXPAVwxThread@@@Z)
wxbase26d.lib(utils.obj) : error LNK2001: unresolved external symbol __imp__PostMessageA@16
wxmsw26d_core.lib(frame.obj) : error LNK2001: unresolved external symbol __imp__PostMessageA@16
wxmsw26d_core.lib(app.obj) : error LNK2001: unresolved external symbol __imp__PostMessageA@16
wxbase26d.lib(thread.obj) : error LNK2019: unresolved external symbol __imp__MsgWaitForMultipleObjects@20 referenced in function "public: enum wxThreadError __thiscall wxThreadInternal::WaitForTerminate(class wxCriticalSection &,void * *,class wxThread *)" (?WaitForTerminate@wxThreadInternal@@QAE?AW4wxThreadError@@AAVwxCriticalSection@@PAPAXPAVwxThread@@@Z)
wxbase26d.lib(thread.obj) : error LNK2019: unresolved external symbol __imp__PostThreadMessageA@16 referenced in function "void __cdecl wxWakeUpMainThread(void)" (?wxWakeUpMainThread@@YAXXZ)
wxmsw26d_core.lib(evtloop.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function "public: virtual void __thiscall wxEventLoop::Exit(int)" (?Exit@wxEventLoop@@UAEXH@Z)
wxmsw26d_core.lib(printwin.obj) : error LNK2001: unresolved external symbol __imp__PeekMessageA@20
wxbase26d.lib(basemsw.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function "public: virtual void __thiscall wxConsoleAppTraits::AlwaysYield(void)" (?AlwaysYield@wxConsoleAppTraits@@UAEXXZ)
wxmsw26d_core.lib(window.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function "public: virtual bool __thiscall wxWindow::RegisterHotKey(int,int,int)" (?RegisterHotKey@wxWindow@@UAE_NHHH@Z)
wxmsw26d_core.lib(app.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function "public: static int __cdecl wxApp::GetComCtl32Version(void)" (?GetComCtl32Version@wxApp@@SAHXZ)
wxmsw26d_core.lib(utilsgui.obj) : error LNK2001: unresolved external symbol __imp__PeekMessageA@20
wxbase26d.lib(utils.obj) : error LNK2019: unresolved external symbol __imp__GetWindowThreadProcessId@8 referenced in function "int __stdcall wxEnumFindByPidProc(struct HWND__ *,long)" (?wxEnumFindByPidProc@@YGHPAUHWND__@@J@Z)
wxbase26d.lib(utils.obj) : error LNK2019: unresolved external symbol __imp__EnumWindows@8 referenced in function "int __cdecl wxKill(long,enum wxSignal,enum wxKillError *,int)" (?wxKill@@YAHJW4wxSignal@@PAW4wxKillError@@H@Z)
wxbase26d.lib(utils.obj) : error LNK2019: unresolved external symbol __imp__ExitWindowsEx@8 referenced in function "bool __cdecl wxShutdown(enum wxShutdownFlags)" (?wxShutdown@@YA_NW4wxShutdownFlags@@@Z)
wxbase26d.lib(utils.obj) : error LNK2019: unresolved external symbol __imp__MessageBeep@4 referenced in function "void __cdecl wxBell(void)" (?wxBell@@YAXXZ)
wxbase26d.lib(utils.obj) : error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function _wxCreateHiddenWindow
wxmsw26d_core.lib(toplevel.obj) : error LNK2001: unresolved external symbol __imp__RegisterClassA@4
wxmsw26d_core.lib(app.obj) : error LNK2001: unresolved external symbol __imp__RegisterClassA@4
wxmsw26d_core.lib(notebook.obj) : error LNK2001: unresolved external symbol __imp__RegisterClassA@4
wxmsw26d_core.lib(tooltip.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
wxmsw26d_core.lib(spinctrl.obj) : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "public: virtual __thiscall wxCommandEvent::~wxCommandEvent(void)" (??1wxCommandEvent@@UAE@XZ)
wxmsw26d_core.lib(bmpbuttn.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
wxmsw26d_core.lib(slider95.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
wxbase26d.lib(utils.obj) : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "struct HWND__ * __cdecl CreateWindow(char const *,char const *,unsigned long,int,int,int,int,struct HWND__ *,struct HMENU__ *,struct HINSTANCE__ *,void *)" (?CreateWindow@@YAPAUHWND__@@PBD0KHHHHPAU1@PAUHMENU__@@PAUHINSTANCE__@@PAX@Z)
wxmsw26d_core.lib(toplevel.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
wxmsw26d_core.lib(window.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
wxmsw26d_core.lib(control.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
wxmsw26d_core.lib(textctrl.obj) : error LNK2001: unresolved external symbol __imp__SetCursor@4
wxmsw26d_core.lib(cursor.obj) : error LNK2001: unresolved external symbol __imp__SetCursor@4
wxbase26d.lib(crashrpt.obj) : error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "public: __thiscall BusyCursor::BusyCursor(void)" (??0BusyCursor@@QAE@XZ)
wxmsw26d_core.lib(window.obj) : error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "char const * __cdecl wxGetMessageName(int)" (?wxGetMessageName@@YAPBDH@Z)
wxmsw26d_core.lib(utilsgui.obj) : error LNK2001: unresolved external symbol __imp__SetCursor@4
Process terminated with status 1 (0 minutes, 15 seconds)
52 errors, 1 warnings

I don't know those it matter but I didn't downloaded Platform SDK, I used one from MS Visual Studio installation. Then I tried with libs from Visual Studio, and I get identical errors like above.
Finally I compiled release version of wxWidgets with help of MS Visual Studio and give it a try, and again I have got same errors.
Where the hell I mistaking?

Why is so hard to make code::bloks compile wxWidgets applications? I read posts on forum and find out that there are many peoples who had problems whit this issue. When I find code::bloks on internet, couple days ago, and read that it is build with wxWidgets, I thought that compiling and running wxWidgets application from Code::Bloks would be easy thing, but it become very difficult thing.

zieQ

  • Guest
Re: problems compiling default wxWidgets application
« Reply #4 on: August 04, 2005, 07:05:44 pm »
There still may be some issues with the visual workspace loaders. I didn't try to compile wxWidgets when imported to C::B, so I can't tell you if I'm right or not. May you do not set the libraries correctly, I can't confirm you anything from the log you sent. I would not be surprised if the visual importer did not import wxWidget workspace well. You may check the projects compiler options in the second case to see if there's no two runtime libraries set for the projects (at the bottom of the option list - that addresses the "already defined in LIBC.lib" problem).

However, I have already recommended you to compile wxWidgets from the makefiles and not from C::B, you should try. There will be NO problem in this case, since that what I have done, provided that you set the PATH environment variable correctly to point your compiler directory. Please follow the build instructions shipped with wxWidgets.

takeshimiya

  • Guest

pivica

  • Guest
Re: problems compiling default wxWidgets application
« Reply #6 on: August 05, 2005, 01:09:20 pm »
Hi all,

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

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)
....

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

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.

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


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.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: problems compiling default wxWidgets application
« Reply #7 on: August 05, 2005, 02:14:50 pm »
Quote
Or here http://wiki.wxwidgets.org/wiki.pl?CodeBlocks_Setup_Guide 
ok, the guide says...

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

  • Guest
Re: problems compiling default wxWidgets application
« Reply #8 on: August 05, 2005, 03:13:59 pm »
True, I forgot to write that the guide is for MINGW, not CYGWIN nor MSYS.

pivica

  • Guest
Re: problems compiling default wxWidgets application
« Reply #9 on: August 06, 2005, 09:23:28 pm »
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.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: problems compiling default wxWidgets application
« Reply #10 on: August 07, 2005, 05:02:13 am »
Maybe it could be that the wxwidgets dll that you're loading is the one that comes with codeblocks, and the one you compiled with was another one.

But I'm not too sure about it... in the meantime, try compiling with static libraries (sorry :( )

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: problems compiling default wxWidgets application
« Reply #11 on: August 07, 2005, 09:45:30 am »
Mismatch between the program and library build version detected,
   The library used 2.6 ([...], compiler with C++ ABI 102, [...]), and your program used 2.6 ([...], compiler with C++ ABI 1002, [...]).
(Edited your quote a bit to make the difference stand out more)
The problem is that your library was compiled with another ABI (Application Binary Interface) than your program. This is most likely due to you using a more recent compiler than was used to compile the library. (102 is the default for GCC 3.2-3.3, 1002 is the default for GCC 3.4)
One way to fix this is to compile wxWidgets with your current compiler (technically, one with the same ABI will suffice).
According to this page, another way to fix this is to use the compiler option -fabi-version=1 in GCC 3.4.x to tell it to use the older ABI when compiling your program, so that it will have the same ABI as your library. Though I've never done this, it should work and seems like the easiest (read: laziest :P) solution to your problem, as recompiling wxWidgets can take a while :(.

pivica

  • Guest
Re: problems compiling default wxWidgets application
« Reply #12 on: August 10, 2005, 02:08:43 pm »
Thanks Urxae, and all the rest of guys who helped me. Finally I manage to compile everything.