User forums > Using Code::Blocks
Installed but can't compile
Michael:
Hello,
I think that the best solution is trying other than asking this forum (which is anyway very important) to look if you do not have missed some compiler/linker options and include/lib directories. If you use the free MS toolkit compiler, also look at the compiler hints:
http://wiki.codeblocks.org/index.php/Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE#Compiling_Hints
I have also had such frustrating experiences when trying DevC++ examples. Most of the time it was a missing parameter or a bad chosen one or the code automatically generated by the IDE was incorrect.
A search with Google could also be very useful.
Best wishes,
Michael
jsimmons:
--- Quote from: thomas on August 15, 2005, 02:40:26 pm ---Do you have things like WXUSINGDLL or __GNUWIN32__ (or whatever is suitable for your project) defined? That is what made me fail the first time I tried building a wxWindows app with code::blocks.
--- End quote ---
I uninstalled and then re-installed, this time without adding wx 2.61. I created a new project (I've tried it using static wx and the using the wx dll, both resulting in the same problem). My project compiler definitions are (I removed __WIN95__):
--- Code: ---WIN32
_WIN32
WINVER=0x0400
__GNUWIN32__
__WIN32__
STRICT
__WXMSW__
__WINDOWS__
WXUSINGDLL
--- End code ---
I added the WX_VER=242 vcustom variable, and turned on "create debugging symbols".
I have the following in my includes directories:
--- Code: ---C:\Program Files\CodeBlocks\include
--- End code ---
When I compile, I get this:
--- Code: ---Project : wxWidgets application
Compiler : GNU GCC Compiler (called directly)
Directory : C:\wxMedbase\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from main.h:4,
from main.cpp:1:
app.h:4:23: wx/wxprec.h: No such file or directory
app.h:11:23: wx/wx.h: No such file or directory
In file included from main.h:4,
from main.cpp:1:
app.h:15: error: expected class-name before '{' token
In file included from main.cpp:1:
main.h:7: error: expected class-name before '{' token
main.h:9: error: expected `)' before '*' token
main.h:12: error: `wxCommandEvent' has not been declared
main.h:12: error: ISO C++ forbids declaration of `event' with no type
main.h:13: error: `wxCommandEvent' has not been declared
main.h:13: error: ISO C++ forbids declaration of `event' with no type
main.h:14: error: ISO C++ forbids declaration of `DECLARE_EVENT_TABLE' with no type
main.cpp:3: error: `wxNewId' was not declared in this scope
main.cpp:4: error: `wxNewId' was not declared in this scope
main.cpp:6: error: `wxFrame' has not been declared
main.cpp:7: error: expected constructor, destructor, or type conversion before "EVT_MENU"
main.cpp:7: error: expected `,' or `;' before "EVT_MENU"
main.cpp:30: error: variable or field `OnQuit' declared void
main.cpp:30: error: `int MyFrame::OnQuit' is not a static member of `class MyFrame'
main.cpp:30: error: `wxCommandEvent' was not declared in this scope
main.cpp:30: error: `event' was not declared in this scope
main.cpp:31: error: expected `,' or `;' before '{' token
main.cpp:35: error: variable or field `OnAbout' declared void
main.cpp:35: error: `int MyFrame::OnAbout' is not a static member of `class MyFrame'
main.cpp:35: error: `wxCommandEvent' was not declared in this scope
main.cpp:35: error: `event' was not declared in this scope
main.cpp:36: error: expected `,' or `;' before '{' token
Process terminated with status 1 (0 minutes, 0 seconds)
25 errors, 0 warnings
--- End code ---
Michael:
app.h:4:23: wx/wxprec.h: No such file or directory
app.h:11:23: wx/wx.h: No such file or directory
Are you sure to have specified correctly all the INCLUDE directories? The compiler cannot find the .h files. Try to look if the necessary INCLUDE directories are set correctly and in the correct location.
Best wishes,
Michael
byo:
Have You added <wx-dir>/lib/mswdll into Your include directories (there's setup.h file which MUST be available somewhere in include paths)
jsimmons:
--- Quote from: Michael on August 15, 2005, 03:31:48 pm ---app.h:4:23: wx/wxprec.h: No such file or directory
app.h:11:23: wx/wx.h: No such file or directory
Are you sure to have specified correctly all the INCLUDE directories? The compiler cannot find the .h files. Try to look if the necessary INCLUDE directories are set correctly and in the correct location.
Best wishes,
Michael
--- End quote ---
Well, I assume that if I create the app with the IDE, it should pretty much be able to find the files, especially if it asks me where to put them when I created the new project. :)
Do I have to include the project directory in the include path?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version