First Program In Wxwidget Topic is solved
First Program In Wxwidget
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
Re: First Program In Wxwidget
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!
Re: First Program In Wxwidget
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
Re: First Program In Wxwidget
Which OS and compiler?
And which command line did you use to build wxWidgets and the sample?
And which command line did you use to build wxWidgets and the sample?
Use the source, Luke!
Re: First Program In Wxwidget
I Used The Following Code: Os: Window7 32bit. Compiler Mingw Version 4.9.2. Wxwidgets Version 3.0.3
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
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
Re: First Program In Wxwidget
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
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...
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"
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...
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: First Program In Wxwidget
Hello, PB. I'm using wxWidgets 3.1.0 built against TDM64-GCC 4.7.1 under Windows 7 64-bit.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...
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: First Program In Wxwidget
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
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: First Program In Wxwidget
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 You can sleep in peace!Chikwado wrote:Then, What's My Next Step? Thanks.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: First Program In Wxwidget
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
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: First Program In Wxwidget
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"]
Re: First Program In Wxwidget
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.
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.
Re: First Program In Wxwidget
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
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: First Program In Wxwidget
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!
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"]