wxWidgets tutorial needed !

General questions regarding the usage of CodeLite
tele
CodeLite Curious
Posts: 7
Joined: Tue Jun 09, 2015 11:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

wxWidgets tutorial needed !

Post by tele »

1. Quick Start
http://codelite.org/LiteEditor/QuickStart
- This is beautifull, I do this without manual.

2. WxWidgets/WxWidgetsBuildParameters is empty :cry:
http://codelite.org/WxWidgets/WxWidgetsBuildParameters

What is my problem ?
I created new project GUI--> Executable (wxWidgets enabled)
Problem is I can not compile:
/home/gg/codelite/test/main.cpp:1:19: fatal error: wx/wx.h: No such file or directory
#include <wx/wx.h>
What I tried ?
- find wx.h file

Code: Select all

$ locate wx.h
/home/gg/src/rpm/BUILD/codelite-8.0/LiteEditor/stdwx.h
/usr/include/wx-2.8/wx/wx.h
/usr/include/wx-3.0/wx/wx.h
/usr/share/doc/lib64wxgtku2.8-devel/samples/help/doc/wx.htm
/usr/share/doc/lib64wxgtku3.0-devel/samples/help/doc/wx.htm
so this is /usr/include/wx-2.8/wx/wx.h or /usr/include/wx-3.0/wx/wx.h
so I tried fix problem, I changed line

Code: Select all

#include <wx/wx.h>
to / on / into

Code: Select all

#include </usr/include/wx-3.0/wx/wx.h>
and I have next errors

Code: Select all

/usr/include/wx-3.0/wx/wx.h:14:21: fatal error: wx/defs.h: No such file or directory
#include "wx/defs.h"
And what now ? :? I can not change /usr/include/wx-3.0/wx/wx.h , so I need maybe add path, but where ?

I tried like this (through trial and errors) :
I undo line to #include <wx/wx.h> and
Image
Image
Image

Why /usr/include/wx-3.0/ and not /usr/include/wx-3.0/wx/ ?
( option in "Addditional include Paths" on screenshot above )
because part path ( /wx/ ) is in include ( #include <wx/wx.h> ), so will be /usr/include/wx-3.0/

And I have next errors ... :shock:

Code: Select all

/usr/include/wx-3.0/wx/chkconf.h:88:9: error: #error "wxUSE_ANY must be defined, please read comment near the top of this file."
#       error "wxUSE_ANY must be defined, please read comment near the top of this file."

/usr/include/wx-3.0/wx/chkconf.h:96:9: error: #error "wxUSE_COMPILER_TLS must be defined, please read comment near the top of this file."
#       error "wxUSE_COMPILER_TLS must be defined, please read comment near the top of this file."

.......
but I fund on google how compile from terminal:

Code: Select all

$ g++ main.cpp `wx-config --libs` `wx-config --cxxflags` -o test1
$ ./test1
$ 
And looks from terminal looks like working, how do this from codelite ?
I have the same problem on PCLinuxOS 64 bit Mate and Fedora 64bit Mate.
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: wxWidgets tutorial needed !

Post by DavidGH »

Hi,
WxWidgets/WxWidgetsBuildParameters is empty
I'm not sure what's supposed to be there, but from the comment above it it's probably a Windows thing anyway.

To build any wx program, CL needs to be able to find a wx installation. On Linux (and afaik OSX) that means using the wx-config script. You need to add the relevant calls to your Project Settings compiler and linker pages. You probably already have them set up in the QuickStart project, so you can open that and see how it's done. (If you didn't use a wx project for that, then do so first.)

Regards,

David
tele
CodeLite Curious
Posts: 7
Joined: Tue Jun 09, 2015 11:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxWidgets tutorial needed !

Post by tele »

Code: Select all

$ locate wx-config
/etc/alternatives/wx-config
/home/gg/src/rpm/BUILD/codelite-8.0/sdk/wxconfig/wx-config-win.cpp
/home/gg/src/rpm/BUILD/codelite-8.0/sdk/wxconfig/wx-config.project
/usr/bin/wx-config
/usr/bin/wx-config-3.0
/usr/bin/wx-config2.8
/usr/bin/multiarch-x86_64-linux/wx-config-3.0
/usr/bin/multiarch-x86_64-linux/wx-config2.8
/var/lib/rpm/alternatives/wx-config
Ok, I guess this will /usr/bin/wx-config ,
where put this link to codelite settings ? ( I tried but without result :( )
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: wxWidgets tutorial needed !

Post by DavidGH »

Did you try replicating one of the template project's settings, as I suggested? If not, I suggest you do so.

If you did, and it still failed, please post what you did. A screenshot of the Project Settings > Compiler settings and Linker settings pages should be enough.
tele
CodeLite Curious
Posts: 7
Joined: Tue Jun 09, 2015 11:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxWidgets tutorial needed !

Post by tele »

You need to add the relevant calls to your Project Settings compiler and linker pages. You probably already have them set up in the QuickStart project, so you can open that and see how it's done. (If you didn't use a wx project for that, then do so first.)
I don't know what and where put, ( I say about only about projects with wxWitgets )
When you create new project you can chose whichever you want, GUI with wxWidgets or Console with wxWidgets
I want try compile one this example.. Nothing else has changed, this examples are from codelite. ( from "Create New Project" )
( without wxWidgets , "simple executable" example I can compile without problem )
http://codelite.org/LiteEditor/QuickStart
Image

If you have linux, you can try,
on windows you can try from virtualbox create virtual hard-drive and install on virtual hard drive and use linux from virtualbox.
https://www.youtube.com/watch?v=QkJmahizwO4

I tried add /usr/bin/wx-config to project settings to "Global Settings"
I see also in project settings in "Common Stettings" --> "Compiler" something like this
-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)
Image
Maybe I need change ? But for what or how ?
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: wxWidgets tutorial needed !

Post by DavidGH »

I do indeed use Linux :)

What is the output of doing, in a terminal:
wx-config --list
and then:
wx-config --cxxflags

Code: Select all

I see also in project settings in "Common Stettings" --> "Compiler" something like this
-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)
That's what you should see, and it should work if you have an installed wx which is unicode debug.
tele
CodeLite Curious
Posts: 7
Joined: Tue Jun 09, 2015 11:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxWidgets tutorial needed !

Post by tele »

Code: Select all

$ wx-config --list

    Default config is gtk2-unicode-release-2.8

  Default config will be used for output

  Also available in /usr:
    gtk2-unicode-3.0

$ wx-config --cxxflags
-I/usr/lib64/wx/include/ -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ 
From PCLinuxOS 64 bit
Which linux do you use ? :)

From Fedora

Code: Select all

$ wx-config --list
bash: wx-config: command not found

$ wx-config --cxxflags
bash: wx-config: command not found
However I have installed wxGTK and wxGTK3 on Fedora ( this mean wxWidgets )

Edit:
I installed wxGTK-devel ( wxGTK3-devel I had before ) and:

Code: Select all

$ wx-config --cxxflags
-I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread

]$ wx-config --list

    Default config is gtk2-unicode-release-2.8

  Default config will be used for output

  Also available in /usr:
    gtk3-unicode-3.0
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: wxWidgets tutorial needed !

Post by DavidGH »

I actually use debian, but I have vbox guests of lots of other distros too, including PCLinuxOS, all with wx installed.

Part of your problem is that you are using wx2.8, for which distros supply a unicode release build. You're asking for a unicode debug build, which isn't found. The quick fix for that is to change what you're asking for. You can do that in your Workspace View: at the top there is a dropdown that says 'Debug'. Switch to 'Release'.

(BTW recent fedoras add another complication: the wx3.0.2 packages don't use a wx-config from the standard location; but we can worry about that when it causes you a problem ;) .)
tele
CodeLite Curious
Posts: 7
Joined: Tue Jun 09, 2015 11:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxWidgets tutorial needed !

Post by tele »

You can do that in your Workspace View: at the top there is a dropdown that says 'Debug'. Switch to 'Release'.
In my.project file ?
Part of your problem is that you are using wx2.8
So in your PCLinuxOS example with wxWidgets compiled and working ?
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: wxWidgets tutorial needed !

Post by DavidGH »

So in your PCLinuxOS example with wxWidgets compiled and working ?
I didn't say I built CodeLite in every vbox guest ;) . I only support the various debian-type distros plus fedora and openSUSE.
However I have wx itself working in PCLinuxOS without any problem.
In my.project file ?
No, see the screenshot.
You do not have the required permissions to view the files attached to this post.
Post Reply