Page 1 of 2

Build error with wxWidget in windows XP

Posted: Sun Jun 01, 2008 3:46 pm
by cls555
I have created an helloworld app.
error message:

uilding: "mingw32-make.exe" -j 1 -f "Codelite_wsp.mk" type=Debug
----------Building project:[ helloworld - ReleaseUnicode ]----------

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll\mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll\mswud)
to specify which configuration exactly you want to use.
g++: /MD: No such file or directory
g++: /DWIN32: No such file or directory
g++: /D__WXMSW__: No such file or directory
g++: /D_UNICODE: No such file or directory
g++: /IG:\CPPLIB\wxWidget\wxWidgets-2.8.7\lib\vc_lib\mswu: Invalid argument
g++: /IG:\CPPLIB\wxWidget\wxWidgets-2.8.7\include: Invalid argument
g++: /D_WINDOWS: No such file or directory
g++: /GR: No such file or directory
g++: /EHsc: No such file or directory
mingw32-make.exe[1]: *** [ReleaseUnicode/helloworld_frame.o.d] Error 1
mingw32-make.exe: *** [All] Error 2
----------Build Ended----------

Could anyone help me?

Re: Build error with wxWidget in windows XP

Posted: Sun Jun 01, 2008 4:49 pm
by eranif
Hi,

I see here several errors;
1. g++ is using VC flags, is that intended?, if not, then change the compiler to be "gnu g++" (Right click on your project and select "settings..."), change the compiler to be "gnu g++"

2. CodeLite is using wx-config tool to get the correct path to your wxWidgets installation. Please set these two environment variables (right click on "My Computer" -> Properties -> Advanced Tab -> Environment Variables:
WXCFG=gcc_dll\mswu
WXWIN=C:\path\to\your\wx\installation (e.g. WXWIN=C:\wxWidgets-2.8.7)

Note that after settings these environment variables, you will need to restart CodeLite.

Quick question:
How did you create this project? did u use the 'New wxWidgets project' button from the toolbar?

Eran

Re: Build error with wxWidget in windows XP

Posted: Mon Jun 02, 2008 3:51 pm
by cls555
Hi Eran!
I have compiled wxWidget with VC,so the compiler setting should be VC. I changed it to VC now and got this error message:

Code: Select all

Building: "mingw32-make.exe"  -j 1 -f "Codelite_wsp.mk" type=Debug
----------Building project:[ helloworld - ReleaseUnicode ]----------
cl.exe /nologo /c helloworld_app.cpp /MD /DWIN32 /D__WXMSW__ /D_UNICODE /IG:\CPPLIB\wxWidget\wxWidgets-2.8.7\lib\vc_lib\mswu /IG:\CPPLIB\wxWidget\wxWidgets-2.8.7\include /D_WINDOWS /GR /EHsc    /D__WX__    /Fo./ReleaseUnicode/helloworld_app.obj /I"C:/Program Files/Microsoft Visual Studio 8/VC/include" /I.   
'cl.exe' mingw32-make.exe[1]: *** [ReleaseUnicode/helloworld_app.obj] Error 1
mingw32-make.exe: *** [All] Error 2
----------Build Ended----------
My environment variables:
WXCFG = vc_dll\mswu
WXWIN = G:\CPPLIB\wxWidget\wxWidgets-2.8.7

wxWidget libs are in:
G:\CPPLIB\wxWidget\wxWidgets-2.8.7\lib\vc_lib\mswu\

Re: Build error with wxWidget in windows XP

Posted: Mon Jun 02, 2008 3:59 pm
by eranif
Hi,

I fail to see compiler error here...

Two more tests:

- When you open DOS shell (Start -> Run -> cmd.exe), and you type cl.exe, what is the output u get?
- can you try and run the build command from the command line? (start -> run -> cmd.exe) and then type:

Code: Select all

mingw32-make.exe  -f Codelite_wsp.mk
(cd to the workspace path, where Codeilte_wsp.mk exists)

Eran

Re: Build error with wxWidget in windows XP

Posted: Mon Jun 02, 2008 8:21 pm
by cls555
Hi,
Oh!I see.Every time when I launch VC,"vsvars32.bat" run automaticly.CodeLite do not run "vsvars32.bat",so the problem happens.
Do I have an alternative choice that do not run it manually and also do not compile it in the cmd way ?

Re: Build error with wxWidget in windows XP

Posted: Mon Jun 02, 2008 9:49 pm
by eranif
Currently, codelite does not offer anyway of running environment script prior its launch. However, a simple one do exist:

open cmd.exe shell
run:

Code: Select all

vsvars32.bat
launch CodeLIte by typing:

Code: Select all

CodeLite.exe
CodeLite should now be able to compile your code properly

Eran

Re: Build error with wxWidget in windows XP

Posted: Tue Jun 03, 2008 4:42 am
by cls555
Thank you! :)

Re: Build error with wxWidget in windows XP

Posted: Sat Nov 22, 2008 6:33 pm
by PAVLVS
Dear Eran,
Many thanks for this amazing IDE (both in features and lightweight), You should have got used to receive thanks ;) .
I have a problem with compiling wxWidgets application in Windows XP.
It's strange 'cos when I had installed CL (package with MinGW and wxWidgets 2.8.7), it worked. Now, when I try to compile the project (created from New wxWidgets Project creator button), I get following output:

Code: Select all

Building: 
"mingw32-make.exe"  -j 1 -f "wspTestWX_wsp.mk"
----------Building project:[ wxTestApp - Debug ]----------
g++ -c  "E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp" -g -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IE:\Prog\wxWidgets287\lib\gcc_dll\mswud -IE:\Prog\wxWidgets287\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0    -D__WX__  -o ./Debug/wxtestapp_app.o 
In file included from E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:1:
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.h:4:20: wx/app.h: No such file or directory
In file included from E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:1:
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.h:6: error: expected class-name before '{' token
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:2:22: wx/image.h: No such file or directory
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:3:23: wx/sysopt.h: No such file or directory
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:4:27: wx/xrc/xmlres.h: No such file or directory
In file included from E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:5:
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_frame.h:4:22: wx/frame.h: No such file or directory
In file included from E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:5:
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_frame.h:6: error: expected class-name before '{' token
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_frame.h:13: error: expected `)' before '*' token
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_frame.h:23: error: ISO C++ forbids declaration of `DECLARE_EVENT_TABLE' with no type
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_frame.h:23: error: expected `;' before "void"
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_frame.h:24: error: `wxCommandEvent' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_frame.h:24: error: ISO C++ forbids declaration of `e' with no type
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:9: error: expected constructor, destructor, or type conversion before "WxtestappApp"
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp: In member function `virtual bool WxtestappApp::OnInit()':
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:20: error: `wxSystemOptions' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:20: error: `_T' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:20: error: `SetOption' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:21: error: `wxXmlResource' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:21: error: `Get' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:22: error: `wxImage' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:22: error: `wxPNGHandler' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:22: error: `AddHandler' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:23: error: `wxImage' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:23: error: `wxCURHandler' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:24: error: `wxImage' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:24: error: `wxICOHandler' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:25: error: `wxImage' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:25: error: `wxXPMHandler' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:26: error: `wxImage' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:26: error: `wxGIFHandler' has not been declared
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:28: error: `wxFrame' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:28: error: `frame' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:28: error: `NULL' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:29: error: `wxID_ANY' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:30: error: `wxT' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:31: error: `wxDefaultPosition' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:32: error: `wxSize' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:32: error: new initializer expression list treated as compound expression
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:36: error: `TRUE' was not declared in this scope
E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp:37: error: `SetTopWindow' was not declared in this scope
mingw32-make[1]: *** [Debug/wxtestapp_app.o] Error 1
mingw32-make.exe: *** [All] Error 2
34 errors, 0 warnings, total time: 00:00:01 seconds
----------Build Ended----------
[/size]
It seems very bizarre because wxWidgets distrib. should be OK, MinGW also, environment variables are set correctly (WXWIN=E:\Prog\wxWidgets287, WXCFG=gcc_dll\mswu). What is more, when I type in console the first compiler call:

Code: Select all

g++ -c  "E:/Prog/CodeLite/Projects/wspTestWX/wxtestapp_app.cpp" -g -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IE:\Prog\wxWidgets287\lib\gcc_dll\mswud -IE:\Prog\wxWidgets287\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0    -D__WX__  -o ./Debug/wxtestapp_app.o 
it makes an object file without errors. But from the CodeLite, it sees no header (despite -IE:\Prog\wxWidgets287\include argument).
Could You help me? Thanks in advance,
PAVLVS

Re: Build error with wxWidget in windows XP

Posted: Sat Nov 22, 2008 7:09 pm
by eranif
Two things to check:
1) Is 'E:\Prog\wxWidgets287\include\' the correct path of your WX installation?
2) Are you using MSYS? if you do set the environment variable SHELL (from the menu: settings -> environment variables...) to cmd.exe as described in this post:
http://codelite.org/forum/viewtopic.php ... HELL#p1080

Eran

Re: Build error with wxWidget in windows XP

Posted: Sat Nov 22, 2008 8:20 pm
by PAVLVS
eranif wrote:Is 'E:\Prog\wxWidgets287\include\' the correct path of your WX installation?
Yes, it is.
eranif wrote:Are you using MSYS? if you do set the environment variable SHELL (...)
I don't know, it depends on the MinGW distribution bundled to CodeLite.

ACTUALIZED:
I've done what You'd suggested (variable SHELL=cmd.exe) and now it works!
Thank You, Eran!