On Sat, 13 May 2023 at 21:39, Lex Trotman <elextr@gmail.com> wrote:
>
> Note this is a wx question, not a Geany question.
>
> You need to set the wx includes directories for compiles and probably
> library directories for the linker.
To add, a C++ compiler does not know where to find anything other than
the standard library, the programmer has to tell it.
I might add that as soon as you have more than one C++ file you
probably want to use a build tool, so its probably worth doing that
even with one file.
The minimal one is "make" (which is a default Build menu item in
Geany) or one of the higher level ones like Cmake or Meson which might
provide more support for using wx, and you can set one of the Geany
build commands to run it.
>
> I am not a wx user and my quick perusal of the wx website did not show
> any information about how to build a wx program, not even the "hello
> world" one.
>
> Perhaps you can ask on the wx support and point out that this is
> missing information for newbies.
>
> Cheers
> Lex
>
> On Sat, 13 May 2023 at 21:00, Jean-Philippe Combe via Users
> <users@lists.geany.org> wrote:
> >
> > Hello everyone,
> >
> > I use Geany for many years for Pearl and MQL4 language but I would like to learn standard c++ with Geany and I have some problems to compile :
> >
> > My example program :
> > //#include <wx/wx.h>
> > #include "/usr/include/wx-3.2/wx/wx.h" // this file exists !
> >
> > class MyApp : public wxApp
> > {
> > public:
> > virtual bool OnInit();
> > };
> >
> > class MyFrame : public wxFrame
> > {
> > public:
> > MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
> > };
> >
> > bool MyApp::OnInit()
> > {
> > MyFrame *frame = new MyFrame("Hello World", wxPoint(50, 50), wxSize(450, 340));
> > frame->Show(true);
> > return true;
> > }
> >
> > MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
> > : wxFrame(NULL, wxID_ANY, title, pos, size)
> > {
> > wxMenu *menuFile = new wxMenu;
> > menuFile->Append(wxID_EXIT);
> > wxMenuBar *menuBar = new wxMenuBar;
> > menuBar->Append(menuFile, "&File");
> > SetMenuBar(menuBar);
> > CreateStatusBar();
> > SetStatusText("Welcome to wxWidgets!");
> > }
> >
> > wxIMPLEMENT_APP(MyApp);
> >
> >
> > WHEN I BUILD :
> >
> > g++ -Wall -o "wxhello" "wxhello.cpp" (dans le dossier : /home/jpc/projets/Learning_Cpp)
> > In file included from wxhello.cpp:2:
> > /usr/include/wx-3.2/wx/wx.h:14:10: fatal error: wx/defs.h: Aucun fichier ou dossier de ce type
> > 14 | #include "wx/defs.h"
> > | ^~~~~~~~~~~
> > compilation terminated.
> > Compilation échouée.
> >
> > What, where and how to configure Geany Please ?
> >
> > Janfi
> >
> >
> >
> >
> >
> > _______________________________________________
> > Users mailing list -- users@lists.geany.org
> > To unsubscribe send an email to users-leave@lists.geany.org
_______________________________________________
Users mailing list -- users@lists.geany.org
To unsubscribe send an email to users-leave@lists.geany.org