User forums > Using Code::Blocks
Porting a wxWidgets project from Linux to Windows
konze:
Hi,
I wrote a little wxWidgets program for a school project under Linux. But my school uses only Windows XP on their computers an my teacher wants that I compile the project under Windows XP. Unfortunately I get an error while I compile the program. Which preference should I set to compile a program (which is written under Linux) under Windows XP.
Best regards,
konze
Jenna:
I suggest using the wizard to create a wxWidgets project, look how it is done there, or use it as stub for your linux project (after removing the cretaed files from th e project).
konze:
The problem is I have the Code on my USB-stick and if I want to compile the Code I get the following error-message:
--- Code: ---||=== randGen, Debug ===|
||warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: created by a different GCC executable|
.\wx_pch.h|14|error: wx/wxprec.h: No such file or directory|
K:\randGen\randGenMain.cpp|10|warning: K:\randGen\wx_pch.h.gch/Debug_wx_pch_h_gch: created by a different GCC executable|
K:\randGen\randGenMain.h|14|error: wx/sizer.h: No such file or directory|
K:\randGen\randGenMain.h|15|error: wx/stattext.h: No such file or directory|
K:\randGen\randGenMain.h|16|error: wx/menu.h: No such file or directory|
K:\randGen\randGenMain.h|17|error: wx/textctrl.h: No such file or directory|
K:\randGen\randGenMain.h|18|error: wx/panel.h: No such file or directory|
K:\randGen\randGenMain.h|19|error: wx/button.h: No such file or directory|
K:\randGen\randGenMain.h|20|error: wx/frame.h: No such file or directory|
K:\randGen\randGenMain.h|21|error: wx/statusbr.h: No such file or directory|
K:\randGen\randGenMain.cpp|12|error: wx/msgdlg.h: No such file or directory|
K:\randGen\randGenMain.cpp|15|error: wx/settings.h: No such file or directory|
K:\randGen\randGenMain.cpp|16|error: wx/font.h: No such file or directory|
K:\randGen\randGenMain.cpp|17|error: wx/intl.h: No such file or directory|
K:\randGen\randGenMain.cpp|18|error: wx/string.h: No such file or directory|
K:\randGen\randGenMain.h|25|error: expected class-name before '{' token|
K:\randGen\randGenMain.h|28|error: expected ')' before '*' token|
K:\randGen\randGenMain.h|34|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|35|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|36|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|37|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|38|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|39|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|59|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|59|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|60|error: ISO C++ forbids declaration of 'wxStaticText' with no type|
K:\randGen\randGenMain.h|60|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|61|error: ISO C++ forbids declaration of 'wxStaticText' with no type|
K:\randGen\randGenMain.h|61|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|62|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|62|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|63|error: ISO C++ forbids declaration of 'wxStaticText' with no type|
K:\randGen\randGenMain.h|63|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|64|error: ISO C++ forbids declaration of 'wxStatusBar' with no type|
K:\randGen\randGenMain.h|64|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|65|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|65|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|66|error: ISO C++ forbids declaration of 'wxPanel' with no type|
K:\randGen\randGenMain.h|66|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|67|error: ISO C++ forbids declaration of 'wxTextCtrl' with no type|
K:\randGen\randGenMain.h|67|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|68|error: ISO C++ forbids declaration of 'wxTextCtrl' with no type|
K:\randGen\randGenMain.h|68|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|69|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|69|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|72|error: ISO C++ forbids declaration of 'DECLARE_EVENT_TABLE' with no type|
K:\randGen\randGenMain.h|73|error: expected ';' before '}' token|
K:\randGen\randGenMain.h|73|error: expected ';' before '}' token|
K:\randGen\randGenMain.cpp|28|error: 'wxString' does not name a type|
K:\randGen\randGenMain.cpp|51|error: 'wxNewId' was not declared in this scope|
K:\randGen\randGenMain.cpp|52|error: 'wxNewId' was not declared in this scope|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 2 warnings ===|
--- End code ---
xunxun:
--- Quote from: konze on July 08, 2011, 01:14:18 pm ---The problem is I have the Code on my USB-stick and if I want to compile the Code I get the following error-message:
--- Code: ---||=== randGen, Debug ===|
||warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: created by a different GCC executable|
.\wx_pch.h|14|error: wx/wxprec.h: No such file or directory|
K:\randGen\randGenMain.cpp|10|warning: K:\randGen\wx_pch.h.gch/Debug_wx_pch_h_gch: created by a different GCC executable|
K:\randGen\randGenMain.h|14|error: wx/sizer.h: No such file or directory|
K:\randGen\randGenMain.h|15|error: wx/stattext.h: No such file or directory|
K:\randGen\randGenMain.h|16|error: wx/menu.h: No such file or directory|
K:\randGen\randGenMain.h|17|error: wx/textctrl.h: No such file or directory|
K:\randGen\randGenMain.h|18|error: wx/panel.h: No such file or directory|
K:\randGen\randGenMain.h|19|error: wx/button.h: No such file or directory|
K:\randGen\randGenMain.h|20|error: wx/frame.h: No such file or directory|
K:\randGen\randGenMain.h|21|error: wx/statusbr.h: No such file or directory|
K:\randGen\randGenMain.cpp|12|error: wx/msgdlg.h: No such file or directory|
K:\randGen\randGenMain.cpp|15|error: wx/settings.h: No such file or directory|
K:\randGen\randGenMain.cpp|16|error: wx/font.h: No such file or directory|
K:\randGen\randGenMain.cpp|17|error: wx/intl.h: No such file or directory|
K:\randGen\randGenMain.cpp|18|error: wx/string.h: No such file or directory|
K:\randGen\randGenMain.h|25|error: expected class-name before '{' token|
K:\randGen\randGenMain.h|28|error: expected ')' before '*' token|
K:\randGen\randGenMain.h|34|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|35|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|36|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|37|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|38|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|39|error: 'wxCommandEvent' has not been declared|
K:\randGen\randGenMain.h|59|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|59|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|60|error: ISO C++ forbids declaration of 'wxStaticText' with no type|
K:\randGen\randGenMain.h|60|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|61|error: ISO C++ forbids declaration of 'wxStaticText' with no type|
K:\randGen\randGenMain.h|61|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|62|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|62|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|63|error: ISO C++ forbids declaration of 'wxStaticText' with no type|
K:\randGen\randGenMain.h|63|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|64|error: ISO C++ forbids declaration of 'wxStatusBar' with no type|
K:\randGen\randGenMain.h|64|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|65|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|65|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|66|error: ISO C++ forbids declaration of 'wxPanel' with no type|
K:\randGen\randGenMain.h|66|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|67|error: ISO C++ forbids declaration of 'wxTextCtrl' with no type|
K:\randGen\randGenMain.h|67|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|68|error: ISO C++ forbids declaration of 'wxTextCtrl' with no type|
K:\randGen\randGenMain.h|68|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|69|error: ISO C++ forbids declaration of 'wxButton' with no type|
K:\randGen\randGenMain.h|69|error: expected ';' before '*' token|
K:\randGen\randGenMain.h|72|error: ISO C++ forbids declaration of 'DECLARE_EVENT_TABLE' with no type|
K:\randGen\randGenMain.h|73|error: expected ';' before '}' token|
K:\randGen\randGenMain.h|73|error: expected ';' before '}' token|
K:\randGen\randGenMain.cpp|28|error: 'wxString' does not name a type|
K:\randGen\randGenMain.cpp|51|error: 'wxNewId' was not declared in this scope|
K:\randGen\randGenMain.cpp|52|error: 'wxNewId' was not declared in this scope|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 2 warnings ===|
--- End code ---
--- End quote ---
You should add wx's header and lib search path to cb.
Jenna:
You either need scripting or (much more easy) different targets for linux and windows.
In this case you can set the appropriate options for each platform and easily share the same project-file for both platforms.
Navigation
[0] Message Index
[#] Next page
Go to full version