First Program In Wxwidget Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
User avatar
Chikwado
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria
Contact:

First Program In Wxwidget

Post by Chikwado »

After Building Wxwidget, How To Test And Verify If The Building Was Successfull. I Need A Cue.
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: First Program In Wxwidget

Post by doublemax »

Assuming you built wxWidgets using the command line, go to <wxdir>/samples/minimal/ and use the same command as when building the library. That should build the "minimal" sample.
Use the source, Luke!
User avatar
Chikwado
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria
Contact:

Re: First Program In Wxwidget

Post by Chikwado »

The Commandline Is Pouring Out Error. Something Like This: "SHARED=0 Is Not Recognized As Internal Or External Command" And "Monolithic=1 Is Not Recognized As Internal And External Command.. What's The Problem.
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: First Program In Wxwidget

Post by doublemax »

Which OS and compiler?

And which command line did you use to build wxWidgets and the sample?
Use the source, Luke!
User avatar
Chikwado
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria
Contact:

Re: First Program In Wxwidget

Post by Chikwado »

I Used The Following Code:

Code: Select all

mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport-std" BUILD=debug mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport-std=gnu++11" BUILD=release 
Os: Window7 32bit. Compiler Mingw Version 4.9.2. Wxwidgets Version 3.0.3
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: First Program In Wxwidget

Post by PB »

BTW, the command line has several issues, even if we assume that two lines got merged by accident when posting on the forum. It should be like shits

Code: Select all

mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=1 CXXFLAGS="-std=gnu++11"  
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 CXXFLAGS="-std=gnu++11" 
Originally, you had two options melted together, I belive that "-fno-keep-inline-dllexport" is not needed in non-shared builds. You can significantly speed-up GCC builds with the -j option but that gets a bit more complicated so let's leave it alone for now.

Assuming the build went well and did not end with errors, go the WXWIN/samples/minimal directory and use the exact same commands to build the minimal sample.

BTW, why wxWidgets 3.03? The last official release in the 3.0 branch is 3.04, if you are starting from scratch and do not need backwards compatibility, I would recommend going with 3.1.1. OTOH, who knows whether current wxWidgets version works with a relatively old toolchain, which is not officially supported. But even wxWidgets 3 are built with MinGW with GCC 5.3...
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: First Program In Wxwidget

Post by eranon »

PB wrote:OTOH, who knows whether current wxWidgets version works with a relatively old toolchain, which is not officially supported. But even wxWidgets 3 are built with MinGW with GCC 5.3...
Hello, PB. I'm using wxWidgets 3.1.0 built against TDM64-GCC 4.7.1 under Windows 7 64-bit.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
User avatar
Chikwado
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria
Contact:

Re: First Program In Wxwidget

Post by Chikwado »

After Typing The Code You Provide To Build Wxwidgets Version 3.0 Everything Seem Ok. I Navigate To "C:\wxWidget\samples\minimal" And Repeated The Code. Then, What's My Next Step? Thanks.
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: First Program In Wxwidget

Post by eranon »

Chikwado wrote:Then, What's My Next Step? Thanks.
If the minimal example has been correctly linked with the static flavor of wxWidgets, it means the libs were well there and linkable... So, job done! You have nothing more to do to validate your wxWidgets building. If you need to be reassured a step more, you can launch the minimal example's executable, then build all the other examples to be sure every single lib is here and ready... but chance it will be OK :mrgreen: You can sleep in peace!
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
User avatar
Chikwado
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria
Contact:

Re: First Program In Wxwidget

Post by Chikwado »

Can Some One Tell Me What I Am Doing Wrong Here. After Building Wxwidget I Had Wxwidget In The C:\wxWidget, C:\Mingw and my folder C:\source ( I Don't Want To Use Virtual Studio Or Codeblock) I Created Wxwidget File And Placed It In C:\source. To Compile It I Got This Erorr: "test.cpp:1:19: fatal error wx/wx.h: No Such File Or Directory, Compilation Terminated", I Have Added Sytem Variable Before Testing My Code.
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: First Program In Wxwidget

Post by eranon »

Hmmm, if you don't want to use any IDE (neither Visual Studio/MSVC nor Code::Blocks/MinGW), you have to master the command line for building by yourself... So, here, all is said in your build log: the header file "wx/wx.h" is not in one of the search paths you indicated for the header files. You have to add the required one in a "-I" option (see https://gcc.gnu.org/onlinedocs/gcc/Dire ... tions.html).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: First Program In Wxwidget

Post by ONEEYEMAN »

Hi,
Which command did you use to build you source?
As eranon said you should add the "-I" switch to that line. You will have to add the "-L" option to that line as well.

Be advised: using IDE will be much-much simpler, especially for C++ newbie.

Thank you.
User avatar
Chikwado
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria
Contact:

Re: First Program In Wxwidget

Post by Chikwado »

I have verified that program by navigating to C:\wxWidget\samples\minimal\gcc_mswud>minimal.exe and have seen a success message. Thanks for all the supports.
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: First Program In Wxwidget

Post by eranon »

You talked about your own first program under C:\source. What's the relationship with C:\wxWidget\samples\minimal\gcc_mswud\minimal.exe?

Also, you auto-congratulate yourself with a SOLVED tag against your own post. It's not the way it works: you have to attach the SOLVED tag to the post that helped you the most. It's not as important here as it could be in other places, but just try to do the same at stackoverflow.com for example... Complaints stack will overflow for sure and you'll get no answer the next time you need help!
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Post Reply