User forums > Using Code::Blocks

c::B with mingw sdl under Fedora 15 - errors when compile...

(1/1)

mythcat:
OK , the imput data :
- create default SDL project with C::B ver 10.05., named sdl-001
- with yum I add this :

--- Code: ---yum install SDL-devel.i686
yum install SDL.i686
yum install wxBase.i686
yum install mingw32-w32api.noarch

--- End code ---
Under project Build options... , on top of project sdl-001:
the wizard add on Compiler ... Other option : `sdl-config --cflags` and Linker : `sdl-config --libs`
when I try compile I got this error :

--- Code: ---libmingw32.a(main.o):(.text+0xd2): undefined reference to `_WinMain@16'
--- End code ---
I found this link : http://cat-in-136.blogspot.com/2010/03/mingw32undefined-reference-to-winmain16.html
So i think this changes will working :

--- Code: --- #include <windows.h>
 #include <tchar.h>
 int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
--- End code ---
But I got this errors:

--- Code: ---
-------------- Clean: Debug in sdl-001 ---------------

Cleaned "sdl-001 - Debug"

-------------- Build: Debug in sdl-001 ---------------

Compiling: main.cpp
In file included from /usr/i686-pc-mingw32/sys-root/mingw/include/windows.h:75:0,
                 from /home/cata/C++/sdl-001/main.cpp:12:
/usr/include/wx-2.8/wx/dde.h:15:21: fatal error: wx/list.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
--- End code ---
I add on Compiler ... Other option : `wx-config --cxxflags` and Linker :`wx-config --libs`.
Now i got this error :

--- Code: ----------------- Clean: Debug in sdl-001 ---------------

Cleaned "sdl-001 - Debug"

-------------- Build: Debug in sdl-001 ---------------

Compiling: main.cpp
i686-pc-mingw32-g++: unrecognized option '-pthread'
In file included from /usr/include/wx-2.8/wx/defs.h:21:0,
                 from /usr/include/wx-2.8/wx/list.h:32,
                 from /usr/include/wx-2.8/wx/dde.h:15,
                 from /usr/i686-pc-mingw32/sys-root/mingw/include/windows.h:75,
                 from /home/cata/C++/sdl-001/main.cpp:12:
/usr/include/wx-2.8/wx/platform.h:540:33: fatal error: wx/msw/libraries.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
--- End code ---
At this point I got stuck. I understand that Wizard is not good?
And why not working definition of wizard main : int main ( int argc, char** argv )?
What would be the right way to setup, create and debug a project?
I read all sorts of sites about this issue, unfortunately are not organized enough in my mind, so I try to clarify me on this project.
Regards .

stahta01:
Install the full version of wxWidgets or do NOT include it when cross Compiling.
You might try wxGTK-dev and see if that works.
I suggest reading the cross compile thread on this site somewhere; it might help you.

Tim S.

Jenna:
You need a cross-build wxwidgets library of wxWidgets, wxGTK-dev will most likely not work, due to incorrect defines in the setup-header.
See: http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux.
I wrote it for debian/ubuntu, but it should work more or less the same way on all linux distros.

Navigation

[0] Message Index

Go to full version