Author Topic: why cant i use the exact project (console, wxwidgets)in linux or windows ?  (Read 5704 times)

Offline Master

  • Multiple posting newcomer
  • *
  • Posts: 53
hi, im planning to code a cross platform application ! so far so good !
the problem is that ,  i worked on a program under windows using code blocks wxsmith(GUI stuff so far) ! and it just runs great there ,
but when i try to compile that project again in Linux (using the cbp file! under the other OS), with the exact files ,when i run the project and try to compile it , it says "#include <wx/wxprec.h>" wxprec.h not found !!! :shock: :shock: , so , the catch here is , when i manually add the source codes , header files to the project (not using wxsmith) everything runs Ok again both under Linux and windows(the project runs with out any problem! !) why is this happening? is it a bug ? or i made a mistake some where that i dont know ,ive updated the wxwidgets to the latest version today 2.8.9.1 i think( but windows wxwidgets is updated to 2.8.9 i think , i mention this  may be it could be important ! )
 
i use ubuntu hardy heron , and thats all that matters , i think!
and by the way , the same thing goes to the console applications, if i start a console application under linux , and code a simple hello app,
Code
#include <iostream>

using std::cout;
using std::endl;

int main()
{
    cout << "Hello There!" << endl;

    return 0;
}
it wont run under windows! , i have to manually re add them to the project ! and of course to an empty project ! and if i dont do that , i get an error "
Code
||=== First Console app, Debug ===|
obj\Debug\main.o||In function `_ZSt17__verify_groupingPKcjRKSs':|
\usr\include\c++\4.2\bits\locale_facets.tcc|2562|undefined reference to `_ZNKSs4sizeEv'|
\usr\include\c++\4.2\bits\locale_facets.tcc|2571|undefined reference to `_ZNKSsixEj'|
\usr\include\c++\4.2\bits\locale_facets.tcc|2573|undefined reference to `_ZNKSsixEj'|
\usr\include\c++\4.2\bits\locale_facets.tcc|2578|undefined reference to `_ZNKSsixEj'|
obj\Debug\main.o||In function `main':|
\media\Programming Session\Coding Stuffs\Programming Stuff\Programming Center\C++\Linux Based Projects\First Console app\main.cpp|8|undefined reference to `_ZSt4cout'|
\media\Programming Session\Coding Stuffs\Programming Stuff\Programming Center\C++\Linux Based Projects\First Console app\main.cpp|8|undefined reference to `_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc'|
\media\Programming Session\Coding Stuffs\Programming Stuff\Programming Center\C++\Linux Based Projects\First Console app\main.cpp|8|undefined reference to `_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_'|
\media\Programming Session\Coding Stuffs\Programming Stuff\Programming Center\C++\Linux Based Projects\First Console app\main.cpp|8|undefined reference to `_ZNSolsEPFRSoS_E'|
obj\Debug\main.o||In function `__static_initialization_and_destruction_0':|
\usr\include\c++\4.2\iostream|77|undefined reference to `_ZNSt8ios_base4InitC1Ev'|
\usr\include\c++\4.2\iostream|77|undefined reference to `__dso_handle'|
\usr\include\c++\4.2\iostream|77|undefined reference to `__cxa_atexit'|
obj\Debug\main.o||In function `__tcf_0':|
\usr\include\c++\4.2\iostream|77|undefined reference to `_ZNSt8ios_base4InitD1Ev'|
F:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\libmingw32.a(main.o):main.c:(.text+0x104)||undefined reference to `_WinMain@16'|
obj\Debug\main.o:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
||=== Build finished: 14 errors, 0 warnings ===|

what should i do to use the wxsmith (cbp ) under both OSes , and also the console app projects!
( im using the original codeblocks , not any nightly build version !)
a man's dream is an index to his greatness...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Linux and Windows projects need different settings for nearly everything. It's better if you try to make a linux cbp and a windows cbp. Yes, it's a pain - I've managed to make a cross-platform .cbp by tweaking some settings manually, but I don't remember exactly.

Sorry.

Edit: http://forums.codeblocks.org/index.php/topic,8643.msg63221.html#msg63221

There's how I solved everything. Notice that you may still need to do some wxWidgets adjustments like handling unicode and all that. Good luck.
« Last Edit: October 15, 2008, 07:39:07 pm by rickg22 »

Offline Master

  • Multiple posting newcomer
  • *
  • Posts: 53
many tanx , ill give it a try !
tanx a million(hope it solves everything ):)
and by the way dose this fix the console application projects problem too? or should  i seek some other solutions for that ? 
 
a man's dream is an index to his greatness...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: why cant i use the exact project (console, wxwidgets)in linux or windows ?
« Reply #3 on: December 11, 2008, 03:33:54 am »
console apps should be easier to handle, I think. Just make sure you don't depend on OS-specific libraries.

Offline Dikei

  • Single posting newcomer
  • *
  • Posts: 2
Re: why cant i use the exact project (console, wxwidgets)in linux or windows ?
« Reply #4 on: December 11, 2008, 06:08:44 am »
For the console appication you mentioned, try cleaning the project and rebuild.