Author Topic: c::B with mingw sdl under Fedora 15 - errors when compile...  (Read 6008 times)

Offline mythcat

  • Multiple posting newcomer
  • *
  • Posts: 14
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
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'
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)
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
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
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 .

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: c::B with mingw sdl under Fedora 15 - errors when compile...
« Reply #1 on: June 07, 2011, 01:30:41 pm »
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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: c::B with mingw sdl under Fedora 15 - errors when compile...
« Reply #2 on: June 07, 2011, 05:52:40 pm »
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.