Insta-newb init.h help

CodeLite installation/troubleshooting forum
DoorToDoorGeek
CodeLite Curious
Posts: 8
Joined: Thu Nov 26, 2009 7:47 am
Genuine User: Yes
IDE Question: C++
Contact:

Insta-newb init.h help

Post by DoorToDoorGeek »

Hello All

I am on Ubuntu 9.10, I did install codelite from the page 2.0.3365 and I installed wxWidgets-2.8.10, I created my very first workspace and new wxwdigets project
it auto generated

Code: Select all

#include <wx/init.h>	//wxInitializer
#include <wx/string.h>	//wxString

int main(int argc, char **argv) 
{
	//Initialize the wxWidgets library
	wxInitializer initializer;
	
	//Print the classic hello world
	wxString msg(wxT("Hello World"));
	wxPrintf(wxT("%s\n"), msg.GetData());
	return 0;
}
and I get these errors
Image

Can I ask what the hell am I doing wrong
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by eranif »

To develop with wxWidgets, you need to install the development package of wxWidgets:

Code: Select all

sudo apt-get install libwxgtk2.8-dev
Eran
Make sure you have read the HOW TO POST thread
DoorToDoorGeek
CodeLite Curious
Posts: 8
Joined: Thu Nov 26, 2009 7:47 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by DoorToDoorGeek »

Thanks for the quick response, I could of swore I did that already ..... I ran it, it installed 3 packages, same errors when I deleted the .codeliet dir in home so it would recreate all my settings, I re did the first steps, opened the project and clicked "build", "rebuild"
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by eranif »

DoorToDoorGeek wrote:Thanks for the quick response, I could of swore I did that already ..... I ran it, it installed 3 packages, same errors when I deleted the .codeliet dir in home so it would recreate all my settings, I re did the first steps, opened the project and clicked "build", "rebuild"
And? does it work now?

If it does not, please paste here the content of the 'Build' tab (from the bottom pane) - all of it

Eran
Make sure you have read the HOW TO POST thread
DoorToDoorGeek
CodeLite Curious
Posts: 8
Joined: Thu Nov 26, 2009 7:47 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by DoorToDoorGeek »

Here you go, and thanks again, I really think I am going to enjoy codelite

Code: Select all

----------Build Started--------
/bin/sh -c '"make"  -j 2 -f "FirstTest_wsp.mk"'
----------Building project:[ FirstTest - Debug ]----------
  Warning: No config found to match: /usr/bin/wx-config --cxxflags --unicode=yes --static=no --universal=no --debug=yes
           in /usr/lib/wx/config
  If you require this configuration, please install the desired
  library build.  If this is part of an automated configuration
  test and no other errors occur, you may safely ignore it.
  You may use wx-config --list to see all configs available in
  the default prefix.
  Warning: No config found to match: /usr/bin/wx-config --debug=yes --libs --unicode=yes --static=no --universal=no
           in /usr/lib/wx/config
  If you require this configuration, please install the desired
  library build.  If this is part of an automated configuration
  test and no other errors occur, you may safely ignore it.
  You may use wx-config --list to see all configs available in
g++ -c  "/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp" -g   -D__WX__  -o ./Debug/firsttest.o "-I." 
  the default prefix.
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:1:37: error: wx/init.h: No such file or directory
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:2:34: error: wx/string.h: No such file or directory
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp: In function ‘int main(int, char**)’:
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:7: error: ‘wxInitializer’ was not declared in this scope
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:7: error: expected ‘;’ before ‘initializer’
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:10: error: ‘wxString’ was not declared in this scope
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:10: error: expected ‘;’ before ‘msg’
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:11: error: ‘wxT’ was not declared in this scope
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:11: error: ‘msg’ was not declared in this scope
/home/ssvalenteno/.codelite/FirstTest/FirstTest/firsttest.cpp:11: error: ‘wxPrintf’ was not declared in this scope
make[1]: *** [Debug/firsttest.o] Error 1
make: *** [All] Error 2
----------Build Ended----------
9 errors, 0 warnings
btw, /usr/bin/wx-config points to /etc/alternatives/wx-config that points to /usr/lib/wx/config/gtk2-unicode-release-2.8 and that does exist
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by eranif »

Hi,

One more question:

What happen if you type from the command line:

Code: Select all

wx-config --cxxflags
Eran
Make sure you have read the HOW TO POST thread
DoorToDoorGeek
CodeLite Curious
Posts: 8
Joined: Thu Nov 26, 2009 7:47 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by DoorToDoorGeek »

Code: Select all

ssvalenteno@ssv-xps:~$ wx-config --cxxflags
-I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread
ssvalenteno@ssv-xps:~$ 
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by eranif »

From the command line, type:

Code: Select all

which wx-config
If the wx-config is not the one under /usr/bin/wx-config do the following:

- open the project settings (right click on the project and select 'Settings')
- in the 'Compiler Options' line, change the /usr/bin/wx-config to wx-config (without any prefix)
- switch to the 'Linker' tab, and do the same here (for the the 'Linker Options' line)

Next, you got another problem:
If you dont have the debug build of wxWidgets (which you can install by typing 'sudo apt-get install libwxgtk2.8-dbg') - remove the '--debug=yes' option from the both the
'Linker' & 'Compiler' Options (from the fields I mentioned above)

Also:
Can you try and build the 'Release' configuration? - to switch to the 'Release' configuration, there is a little choice control on top of the workspace tab that indicates which configuration you are building, by default it is set to 'Debug'

Eran
Make sure you have read the HOW TO POST thread
DoorToDoorGeek
CodeLite Curious
Posts: 8
Joined: Thu Nov 26, 2009 7:47 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Insta-newb init.h help

Post by DoorToDoorGeek »

I right clicked the project in the left pane, then left clicked settings, then clicked on the compiler tab, this is what is entered in the "Compiler Options" textbox

Code: Select all

-g;;$(shell wx-config --cxxflags --unicode=yes --static=no --universal=no --debug=yes )
and the linker tab had

Code: Select all

$(shell wx-config --debug=yes --libs --unicode=yes --static=no --universal=no );
dumb question (sorry I say that a lot, I wouldn't mind at all) should I start over in a fresh vm or do you know of a pre configured downloadable vm image?

***********EDIT

I did "sudo apt-get install libwxgtk2.8-dbg" and it worked, sweet
Post Reply