User forums > Using Code::Blocks

Howto - Cross Compiling in Linux using MingW32

<< < (20/25) > >>

MortenMacFly:

--- Quote from: RagnarDa on March 23, 2012, 10:55:18 pm ---obj/Release/wxLinuxApp.o: file not recognized: File format not recognized

--- End quote ---
...I don't know why, but that's the cause. Help yourself and find out what you are doing there...

In addition, you only show the linking process. What we are asking for is the full build process, so do a clean before or a complete new re-build.

RagnarDa:
I uninstalled mingw32 and sudo apt-get install'ed it again, did a clean and a rebuild the project and this is what i got:


--- Code: ----------------- Clean: WinRelease in wxLinux ---------------

Cleaned "wxLinux - WinRelease"

-------------- Build: WinRelease in wxLinux ---------------

i586-mingw32msvc-g++ -Wall  -O2      -I/usr/i586-mingw32msvc/include -I/usr/i586-mingw32msvc/include  -c /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp -o obj/Release/wxLinuxApp.o
I fil inkluderad från /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:10:
/home/christoffer/Projekt/wxLinux/wxLinuxApp.h:13:20: fel: wx/app.h: Filen eller katalogen finns inte
I fil inkluderad från /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:13:
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:14:21: fel: wx/menu.h: Filen eller katalogen finns inte
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:15:25: fel: wx/statusbr.h: Filen eller katalogen finns inte
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:16:22: fel: wx/frame.h: Filen eller katalogen finns inte
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:14:22: fel: wx/image.h: Filen eller katalogen finns inte
In file included from /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:10:
/home/christoffer/Projekt/wxLinux/wxLinuxApp.h:16: error: expected class-name before ‘{’ token
In file included from /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:13:
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:20: error: expected class-name before ‘{’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:23: error: expected `)' before ‘*’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:29: error: ‘wxCommandEvent’ has not been declared
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:30: error: ‘wxCommandEvent’ has not been declared
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:40: error: ISO C++ forbids declaration of ‘wxStatusBar’ with no type
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:40: error: expected ‘;’ before ‘*’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:43: error: ISO C++ forbids declaration of ‘DECLARE_EVENT_TABLE’ with no type
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:44: error: expected ‘;’ before ‘}’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:44: error: expected `;' before ‘}’ token
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:17: error: expected constructor, destructor, or type conversion before ‘;’ token
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp: In member function ‘virtual bool wxLinuxApp::OnInit()’:
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:23: error: ‘wxInitAllImageHandlers’ was not declared in this scope
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:26: error: no matching function for call to ‘wxLinuxFrame::wxLinuxFrame(int)’
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:20: note: candidates are: wxLinuxFrame::wxLinuxFrame()
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:20: note:                 wxLinuxFrame::wxLinuxFrame(const wxLinuxFrame&)
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:27: error: ‘class wxLinuxFrame’ has no member named ‘Show’
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:28: error: ‘SetTopWindow’ was not declared in this scope
Process terminated with status 1 (0 minutes, 0 seconds)
20 errors, 0 warnings

--- End code ---

Thank you for your quick response!

MortenMacFly:

--- Quote from: RagnarDa on March 23, 2012, 11:44:10 pm ---I uninstalled mingw32 and sudo apt-get install'ed it again, did a clean and a rebuild the project and this is what i got:

--- Code: ---i586-mingw32msvc-g++ -Wall  -O2      -I/usr/i586-mingw32msvc/include -I/usr/i586-mingw32msvc/include  -c /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp -o obj/Release/wxLinuxApp.o

--- End code ---

--- End quote ---
See, and finally we got all information we need. ::)

As you see from the compiler step, you are missing to provide the full set of required wxWidgets flags to compile your wxWidgets app, like include folders, and #defines. So the compiler doesn't not know where to search for the include files as shown in the error messages. Adjust your project settings accordingly and it will work. Inspect the instruction of the wxWidgets library to now how to do so. This is no longer a Code::Blocks issue -> please don't post in this thread again therefore.

Next time, to speed up things, read the forum rules (you agreed to when registering with the forum btw) and post the right stuff in the first place. Also note this (again):
http://forums.codeblocks.org/index.php/topic,9996.0.html
Thank you.

Edit: Typos.

Leshyk:
Thank you very much for this review! It works fine but debuging...

More precisely:
My system is ubuntu. The goal is to compile dll as a plugin for some windows application.
Following the instructions I was able to compile, link and to begin debugging. For debugging mingw32-gdb.exe under wine was used.

The C::B was able to put breakpoint but when the programm stops I have the following error in the debugger window: "The program has stopped on a breakpoint but the breakpoint format is not recognized".

In the source code (http://fossies.org/dox/codeblocks-10.05-src/gdb__driver_8cpp_source.html) I found that this error message appears when the result output doesn't coincide with regexp either reBreak or reBreak_or32 (*). Manually I would say that this string should coincide with reBreak_or32 and, so, there is two cases why the error appears 1) somehow reBreak instead of reBreak_or32 is applied (I tried to change development flower in the C::B settings to 'or32' but nothing changed) 2) there are some invisible symbols which don't coincide with regexp

1) The further way of searching for the solution is to rebuild debuggergdb but how can I rebuild only that module and where should I put the rebuilt module?
2) What else can I do to make the debugger working?

(*) To the developers of debuggergdb, Just a curiosity:
Why you use this kind of code

--- Code: ---   43 #ifdef __WXMSW__
   44     static wxRegEx reBreak(_T("([A-Za-z]*[:]*)([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-Fa-f]+)"));
   45     static wxRegEx reBreak_or32(_T("\032\032([A-Za-z]:)([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-z]+)"));
   46 #else
   47     static wxRegEx reBreak(_T("\032\032([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-Fa-f]+)"));
   48     static wxRegEx reBreak_or32(_T("")); // not used on linux, but make sure it exists otherwise compilation fails on linux (if (platform::windows) blabla)
   49 #endif

--- End code ---
and then trying to select the right version of reBreak or reBreake_or32 while it is mush more understandable to use one regex like this

--- Code: ---static wxRegEx reBreak(_T("\{\032\032\}?(\{[A-Za-z]*[:]*\}?)([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-Fa-f]+)"));

--- End code ---
The performance here seems to be not so much important...

oBFusCATed:
Because we're not regex masters and the wxregex is not that powerful (I suppose your regex would work, though).
Try it and tell us what is the result...

To rebuild, if I were you I'd use the autotools system with a prefix to modify and rebuild C::B.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version