wxwidgets nightmare

CodeLite installation/troubleshooting forum
DaveJ61
CodeLite Curious
Posts: 4
Joined: Sat Dec 29, 2012 12:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

wxwidgets nightmare

Post by DaveJ61 »

I am running Debian Squeeze and started off with CodeBlocks. That all went well until I wanted to change my project to use wxwidgets. It failed to install correctly due to dependency issues and after a several days of trying to install from source and tearing my hair out I gave up.

Next I installed CodeLite, which I must say looks really nice indeed. Only trouble is, I cannot get it to compile the default program after I have created a a new wxwidgets (2.8.0) project. This was installed directly from the Debian repository. I also installed the codelite plugins. I get the following output when trying to build the project. I have also included the main.h and .cpp although that might not be needed as this was automatically generated when creating the project:-
  • /home/dave/.codelite/myweather/gui.h:11:21: error: wx/intl.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:13:23: error: wx/string.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:14:23: error: wx/bitmap.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:15:22: error: wx/image.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:16:21: error: wx/icon.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:17:21: error: wx/menu.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:18:23: error: wx/gdicmn.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:19:21: error: wx/font.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:20:23: error: wx/colour.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:21:25: error: wx/settings.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:22:22: error: wx/sizer.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:23:25: error: wx/statusbr.h: No such file or directory
    /home/dave/.codelite/myweather/gui.h:24:22: error: wx/frame.h: No such file or directory

Code: Select all

/*********************************************************************
 * Name:      	main.cpp
 * Purpose:   	Implements simple wxWidgets application with GUI
 * 				created using wxFormBuilder.
 * Author:    
 * Created:   
 * Copyright: 
 * License:   	wxWidgets license (www.wxwidgets.org)
 * 
 * Notes:		Note that all GUI creation code is implemented in
 * 				gui.cpp source file which is generated by wxFormBuilder.
 *********************************************************************/

#include "main.h"

// initialize the application
IMPLEMENT_APP(MainApp);

////////////////////////////////////////////////////////////////////////////////
// application class implementation 
////////////////////////////////////////////////////////////////////////////////

bool MainApp::OnInit()
{
	SetTopWindow( new MainFrame( NULL ) );
	GetTopWindow()->Show();
	
	// true = enter the main loop
	return true;
}

////////////////////////////////////////////////////////////////////////////////
// main application frame implementation 
////////////////////////////////////////////////////////////////////////////////

MainFrame::MainFrame(wxWindow *parent) : MainFrameBase( parent )
{
}

MainFrame::~MainFrame()
{
}

void MainFrame::OnCloseFrame(wxCloseEvent& event)
{
	Destroy();
}

void MainFrame::OnExitClick(wxCommandEvent& event)
{
	Destroy();
}

Code: Select all

/*********************************************************************
 * Name:      	main.h
 * Purpose:   	Declares simple wxWidgets application with GUI
 * 				created using wxFormBuilder.
 * Author:    
 * Created:   
 * Copyright: 
 * License:   	wxWidgets license (www.wxwidgets.org)
 * 
 * Notes:		Note that all GUI creation code is declared in
 * 				gui.h source file which is generated by wxFormBuilder.
 *********************************************************************/

#ifndef __main__
#define __main__

// main wxWidgets header file
#include <wx/wx.h>
// gui classes generated by wxFormBuilder
#include "gui.h"

////////////////////////////////////////////////////////////////////////////////
// application class declaration 
////////////////////////////////////////////////////////////////////////////////

class MainApp : public wxApp
{
	public:
		virtual bool OnInit();
};

// declare global static function wxGetApp()
DECLARE_APP(MainApp)

////////////////////////////////////////////////////////////////////////////////
// main application frame declaration 
////////////////////////////////////////////////////////////////////////////////

class MainFrame : public MainFrameBase
{
	public:
		MainFrame( wxWindow *parent );
		virtual ~MainFrame();
		
	protected:
		// protected event handlers
		virtual void OnCloseFrame( wxCloseEvent& event );
		virtual void OnExitClick( wxCommandEvent& event );
};

#endif //__main__
I have included the wx directory in the compiler additional search path but the same deal. Although I would have thought the configuration should already have been done as the plugin is installed with Codelite and is also showing the green dot in the "Manage Plugins" plugin status.
I have done quite a lot of searching over the last few days and there seems to be similar issues but they appear to be windows based, not linux.
I haven't got much hair left, so is there anyone that can help before I become totally bald?
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxwidgets nightmare

Post by eranif »

DaveJ61 wrote:I have included the wx directory in the compiler additional search path but the same deal
This is not needed.

Under linux, you should use wx-config --libs / wx-config --cflags

Do this:

close your workspace
workspace -> new project, under the "GUI" category, select project type:
Executable (wxWidgets + wxFB frame)

Fill in the missing blanks
Try to compile it ( do _not_ change anything in the project settings).
Does this compile for you?

If it does not compile (and _before_ you post further questions) please follow these posting guidelines:
HOW TO POST - PLEASE READ

Eran
Make sure you have read the HOW TO POST thread
DaveJ61
CodeLite Curious
Posts: 4
Joined: Sat Dec 29, 2012 12:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxwidgets nightmare

Post by DaveJ61 »

Ok, sorry about he missing info.
My Codelite verion is 2.6.0.4189
The Codelite is installed from the Debian repositories and is not self compiled.
My OS is Debian Squeeze version 6.06.

I tried what you requested but it will still not build the project. I have also created a new workspace and created another project in there with the same outcome.

Code: Select all

----------Build Started--------
/bin/sh -c '"make"  -j 2 -f "test_wsp.mk"'
----------Building project:[ test2 - Debug ]----------

  Warning: No config found to match: /usr/bin/wx-config --cxxflags --unicode=yes --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
           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.

make[1]: Entering directory `/home/dave/.codelite/test'
g++ -c  "/home/dave/.codelite/test/main.cpp" -g  -D__WX__  -o ./Debug/main.o "-I." 
g++ -c  "/home/dave/.codelite/test/gui.cpp" -g  -D__WX__  -o ./Debug/gui.o "-I." 
In file included from /home/dave/.codelite/test/main.cpp:14:
/home/dave/.codelite/test/main.h:18:19: error: wx/wx.h: No such file or directory
In file included from /home/dave/.codelite/test/main.h:20,
                 from /home/dave/.codelite/test/main.cpp:14:
/home/dave/.codelite/test/gui.h:11:21: error: wx/intl.h: No such file or directory
/home/dave/.codelite/test/gui.h:13:23: error: wx/string.h: No such file or directory
/home/dave/.codelite/test/gui.h:14:23: error: wx/bitmap.h: No such file or directory
/home/dave/.codelite/test/gui.h:15:22: error: wx/image.h: No such file or directory
/home/dave/.codelite/test/gui.h:16:21: error: wx/icon.h: No such file or directory
/home/dave/.codelite/test/gui.h:17:21: error: wx/menu.h: No such file or directory
/home/dave/.codelite/test/gui.h:18:23: error: wx/gdicmn.h: No such file or directory
/home/dave/.codelite/test/gui.h:19:21: error: wx/font.h: No such file or directory
/home/dave/.codelite/test/gui.h:20:23: error: wx/colour.h: No such file or directory
/home/dave/.codelite/test/gui.h:21:25: error: wx/settings.h: No such file or directory
/home/dave/.codelite/test/gui.h:22:22: error: wx/sizer.h: No such file or directory
/home/dave/.codelite/test/gui.h:23:25: error: wx/statusbr.h: No such file or directory
/home/dave/.codelite/test/gui.h:24:22: error: wx/frame.h: No such file or directory
In file included from /home/dave/.codelite/test/main.h:20,
                 from /home/dave/.codelite/test/main.cpp:14:
/home/dave/.codelite/test/gui.h:33: error: expected class-name before ‘{’ token
/home/dave/.codelite/test/gui.h:37: error: ISO C++ forbids declaration of ‘wxMenuBar’ with no type
/home/dave/.codelite/test/gui.h:37: error: expected ‘;’ before ‘*’ token
/home/dave/.codelite/test/gui.h:38: error: ISO C++ forbids declaration of ‘wxMenu’ with no type
/home/dave/.codelite/test/gui.h:38: error: expected ‘;’ before ‘*’ token
/home/dave/.codelite/test/gui.h:39: error: ISO C++ forbids declaration of ‘wxStatusBar’ with no type
/home/dave/.codelite/test/gui.h:39: error: expected ‘;’ before ‘*’ token
/home/dave/.codelite/test/gui.h:42: error: ‘wxCloseEvent’ has not been declared
/home/dave/.codelite/test/gui.h:43: error: ‘wxCommandEvent’ has not been declared
/home/dave/.codelite/test/gui.h:48: error: expected ‘)’ before ‘*’ token
/home/dave/.codelite/test/gui.h: In member function ‘virtual void MainFrameBase::OnCloseFrame(int&)’:
/home/dave/.codelite/test/gui.h:42: error: request for member ‘Skip’ in ‘event’, which is of non-class type ‘int’
/home/dave/.codelite/test/gui.h: In member function ‘virtual void MainFrameBase::OnExitClick(int&)’:
/home/dave/.codelite/test/gui.h:43: error: request for member ‘Skip’ in ‘event’, which is of non-class type ‘int’
In file included from /home/dave/.codelite/test/main.cpp:14:
/home/dave/.codelite/test/main.h: At global scope:
/home/dave/.codelite/test/main.h:27: error: expected class-name before ‘{’ token
/home/dave/.codelite/test/main.h:39: error: expected constructor, destructor, or type conversion before ‘class’
/home/dave/.codelite/test/main.cpp:17: error: expected constructor, destructor, or type conversion before ‘;’ token
/home/dave/.codelite/test/main.cpp: In member function ‘virtual bool MainApp::OnInit()’:
/home/dave/.codelite/test/main.cpp:25: error: expected type-specifier before ‘MainFrame’
/home/dave/.codelite/test/main.cpp:25: error: expected ‘)’ before ‘MainFrame’
/home/dave/.codelite/test/main.cpp:25: error: ‘SetTopWindow’ was not declared in this scope
/home/dave/.codelite/test/main.cpp:26: error: ‘GetTopWindow’ was not declared in this scope
/home/dave/.codelite/test/main.cpp: At global scope:
/home/dave/.codelite/test/main.cpp:36: error: ‘MainFrame’ has not been declared
/home/dave/.codelite/test/main.cpp:36: error: expected constructor, destructor, or type conversion before ‘(’ token
/home/dave/.codelite/test/main.cpp:40: error: expected constructor, destructor, or type conversion before ‘::’ token
/home/dave/.codelite/test/main.cpp:44: error: ‘MainFrame’ has not been declared
/home/dave/.codelite/test/main.cpp:44: error: variable or field ‘OnCloseFrame’ declared void
/home/dave/.codelite/test/main.cpp:44: error: ‘wxCloseEvent’ was not declared in this scope
/home/dave/.codelite/test/main.cpp:44: error: ‘event’ was not declared in this scope
/home/dave/.codelite/test/main.cpp:49: error: ‘MainFrame’ has not been declared
/home/dave/.codelite/test/main.cpp:49: error: variable or field ‘OnExitClick’ declared void
/home/dave/.codelite/test/main.cpp:49: error: ‘wxCommandEvent’ was not declared in this scope
/home/dave/.codelite/test/main.cpp:49: error: ‘event’ was not declared in this scope
make[1]: *** [Debug/main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /home/dave/.codelite/test/gui.cpp:8:
/home/dave/.codelite/test/gui.h:11:21: error: wx/intl.h: No such file or directory
/home/dave/.codelite/test/gui.h:13:23: error: wx/string.h: No such file or directory
/home/dave/.codelite/test/gui.h:14:23: error: wx/bitmap.h: No such file or directory
/home/dave/.codelite/test/gui.h:15:22: error: wx/image.h: No such file or directory
/home/dave/.codelite/test/gui.h:16:21: error: wx/icon.h: No such file or directory
/home/dave/.codelite/test/gui.h:17:21: error: wx/menu.h: No such file or directory
/home/dave/.codelite/test/gui.h:18:23: error: wx/gdicmn.h: No such file or directory
/home/dave/.codelite/test/gui.h:19:21: error: wx/font.h: No such file or directory
/home/dave/.codelite/test/gui.h:20:23: error: wx/colour.h: No such file or directory
/home/dave/.codelite/test/gui.h:21:25: error: wx/settings.h: No such file or directory
/home/dave/.codelite/test/gui.h:22:22: error: wx/sizer.h: No such file or directory
/home/dave/.codelite/test/gui.h:23:25: error: wx/statusbr.h: No such file or directory
/home/dave/.codelite/test/gui.h:24:22: error: wx/frame.h: No such file or directory
In file included from /home/dave/.codelite/test/gui.cpp:8:
/home/dave/.codelite/test/gui.h:33: error: expected class-name before ‘{’ token
/home/dave/.codelite/test/gui.h:37: error: ISO C++ forbids declaration of ‘wxMenuBar’ with no type
/home/dave/.codelite/test/gui.h:37: error: expected ‘;’ before ‘*’ token
/home/dave/.codelite/test/gui.h:38: error: ISO C++ forbids declaration of ‘wxMenu’ with no type
/home/dave/.codelite/test/gui.h:38: error: expected ‘;’ before ‘*’ token
/home/dave/.codelite/test/gui.h:39: error: ISO C++ forbids declaration of ‘wxStatusBar’ with no type
/home/dave/.codelite/test/gui.h:39: error: expected ‘;’ before ‘*’ token
/home/dave/.codelite/test/gui.h:42: error: ‘wxCloseEvent’ has not been declared
/home/dave/.codelite/test/gui.h:43: error: ‘wxCommandEvent’ has not been declared
/home/dave/.codelite/test/gui.h:48: error: expected ‘)’ before ‘*’ token
/home/dave/.codelite/test/gui.h: In member function ‘virtual void MainFrameBase::OnCloseFrame(int&)’:
/home/dave/.codelite/test/gui.h:42: error: request for member ‘Skip’ in ‘event’, which is of non-class type ‘int’
/home/dave/.codelite/test/gui.h: In member function ‘virtual void MainFrameBase::OnExitClick(int&)’:
/home/dave/.codelite/test/gui.h:43: error: request for member ‘Skip’ in ‘event’, which is of non-class type ‘int’
/home/dave/.codelite/test/gui.cpp: At global scope:
/home/dave/.codelite/test/gui.cpp:12: error: expected ‘)’ before ‘*’ token
/home/dave/.codelite/test/gui.cpp: In destructor ‘MainFrameBase::~MainFrameBase()’:
/home/dave/.codelite/test/gui.cpp:43: error: ‘class MainFrameBase’ has no member named ‘Disconnect’
/home/dave/.codelite/test/gui.cpp:43: error: ‘wxEVT_CLOSE_WINDOW’ was not declared in this scope
/home/dave/.codelite/test/gui.cpp:43: error: ‘wxCloseEventHandler’ was not declared in this scope
/home/dave/.codelite/test/gui.cpp:44: error: ‘class MainFrameBase’ has no member named ‘Disconnect’
/home/dave/.codelite/test/gui.cpp:44: error: ‘wxID_ANY’ was not declared in this scope
/home/dave/.codelite/test/gui.cpp:44: error: ‘wxEVT_COMMAND_MENU_SELECTED’ was not declared in this scope
/home/dave/.codelite/test/gui.cpp:44: error: ‘wxCommandEventHandler’ was not declared in this scope
make[1]: *** [Debug/gui.o] Error 1
make[1]: Leaving directory `/home/dave/.codelite/test'
make: *** [All] Error 2
----------Build Ended----------
224 errors, 0 warnings
parser includes:-
/usr/include
/usr/include/c++/4.4.5

parser excludes:-
/usr/include/c++/4.4.5/debug


I am not an hardened c++ programmer by any means as I am just trying to get back into it after a 15 year break.I am no slouch and I do understand a fair amount of what is going on but has got me baffled.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxwidgets nightmare

Post by eranif »

DaveJ61 wrote:/usr/bin/wx-config --cxxflags --unicode=yes --debug=yes
The answer is in the compiler output:

You dont have "Debug" package installed, but yet you try to use it

Try building the 'Release' configuration instead of the "Debug"

There should be a drop down control on top of the workspace view to allow you to switch between configurations

Note that 2.6 is pretty old and I strongly recommend you to upgrade to a later release
To ease the process, use our repository:

http://codelite.org/LiteEditor/Repositories

Eran
Make sure you have read the HOW TO POST thread
DaveJ61
CodeLite Curious
Posts: 4
Joined: Sat Dec 29, 2012 12:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxwidgets nightmare

Post by DaveJ61 »

OMG... I feel such a divvy... Sorry for wasting your time folks....
I used to use Borland C++ Builder. I can't ever remember using a seperate debug compilation with C++ Builder. Do I really need the debug files?
Thanks very much for the assistance anyway. Much appreciated.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxwidgets nightmare

Post by eranif »

DaveJ61 wrote:Do I really need the debug files?
Not really.

If you are using Linux, you can compile your code with debug information (-g) while linking with non debug package
This trick won't work on Linux ( you will get a nice segfault :D)

To remove the dependency from the debug libs of wx, do this:
Right click on your project -> settings

Make sure you are editing the 'Debug' configuration (there is a drop down control at the top of the settings dialog)
select the 'Compiler' options and change this command:

Code: Select all

$(shell wx-config --cxxflags --debug=yes) 
to

Code: Select all

$(shell wx-config --cxxflags --debug=no) 
To the same for the linker:

Code: Select all

$(shell wx-config --libs --debug=yes) 
to

Code: Select all

$(shell wx-config --libs --debug=no) 
Eran
Make sure you have read the HOW TO POST thread
DaveJ61
CodeLite Curious
Posts: 4
Joined: Sat Dec 29, 2012 12:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxwidgets nightmare

Post by DaveJ61 »

Thanks for all your help.
Post Reply