While Building Program

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.
User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

While Building Program

Postby Chikwado » Tue Oct 03, 2017 10:44 am

I Am Using Codeblock Verion 16.01 And Wxwidget Version 3.1. While Building My Program I Got The Following Error: (1) wchar_t must be available. (2) <menu.h>: such file not available. I Can Some Help Explain These Please.

User avatar
doublemax
Moderator
Moderator
Posts: 11536
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: While Building Program

Postby doublemax » Tue Oct 03, 2017 5:58 pm

How did you build the wxWidgets libraries? Please post the exact command line.

Also post the exact error messages. If there are many errors, post the first 10-20 lines only.
Use the source, Luke!

User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

Re: While Building Program

Postby Chikwado » Fri Oct 06, 2017 4:30 pm

I Found The Example From This Source: Example1 and Example2. I am completely new to all this stuff. I Need Help.

User avatar
doublemax
Moderator
Moderator
Posts: 11536
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: While Building Program

Postby doublemax » Fri Oct 06, 2017 5:58 pm

As the first link is for Linux: Are you working under Linux?

In any case, forget about CodeBlocks in the beginning. First try to build the wxWidgets libraries and the "minimal" sample that comes with it, from the command line. Once that works, you can try to setup an IDE.

Follow the instructions here:
https://wiki.wxwidgets.org/Compiling_an ... ng_started

If something goes wrong, please tell exactly what you did and what errors you're getting. Otherwise nobody will be able to help you.
Use the source, Luke!

User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

Re: While Building Program

Postby Chikwado » Mon Oct 09, 2017 7:44 am

Thanks For Reply. I Have Heared A Lots Of Statement And Examples That One Must Be Able To Compile And Comfigure Wxwidgets Before Using With Codeblock. For Example Before Installing Wxwidgets I Created A Folder And Name It "wxwidgets" now wxwidgets is residing in C:\wxwidgets, Although I Am Using Window 7. Now To Run The Compiling, On My Window7, I Can Click-> "Start" -> "Search" In Search Field I Can Type "cmd.exe" And Link Will Open Up At The Left Side Of The Screen, Then I Can Right-Click And Select Run As Administrator. Now What Do I Have To Type In Command Line To Start The Compiling Proccess? (Some Source From This Url, Example https://wiki.wxwidgets.org Are not working). Thanks In Advance.
Last edited by Chikwado on Mon Oct 09, 2017 12:38 pm, edited 1 time in total.

User avatar
doublemax
Moderator
Moderator
Posts: 11536
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: While Building Program

Postby doublemax » Mon Oct 09, 2017 10:35 am

Now What Do I Have To Type In Command Line To Start The Compiling Proccess?
The link i posted was for Linux. Ff you're under Windows, this should help:
https://wiki.wxwidgets.org/Compiling_wx ... with_MinGW
Use the source, Luke!

User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

Re: While Building Program

Postby Chikwado » Mon Oct 09, 2017 1:42 pm

Dear Moderator, That Link Could Not Be Open If I Click It, It Return Empty Page. My Codeblocks Version Is: Codeblocks-16.01mingw-setup.exe. Which I Use For Window 7 32bit Do I Need Another Mingw For Wxwidgets? Thanks.

User avatar
doublemax
Moderator
Moderator
Posts: 11536
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: While Building Program

Postby doublemax » Mon Oct 09, 2017 6:03 pm

The link works fine for me.

AFAIK the CB installer does not add the path to MingW to the %PATH% automatically. Open a command window and enter "gcc -v". If it outputs the compiler info, everything is ok so far.

If not, you have to add the path to the compiler (e.g. c:\mingw\bin ) to the %PATH% and restart your system. (Google if you don't know what that means or if you don't know how to do it.)

Once the compiler is found open a command window and navigate to <where you installed wxwidget>\build\msw and enter:

Code: Select all

mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=debug
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=release

If that compiles wxWidgets successfully, continue here:
viewtopic.php?p=169501&sid=8b310aedd3983eb061b59b23aad01393#p169501

This might also be helpful:
viewtopic.php?p=178326#p178326

(BTW: Anyone familiar with MinGW and CodeBlocks willing to make a Wiki page for this? These questions come so often...)
Use the source, Luke!

User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

Re: While Building Program

Postby Chikwado » Tue Oct 10, 2017 2:54 pm

Thanks Moderator For All The Support, My Knowledge Of Wxwidget Is Improving, But... Would I Have To Type Those Code In Command Line And Go "ENTER", Or Would I Have To Open Makefile.gcc In Notepad To Edit It?. Thanks.

User avatar
doublemax
Moderator
Moderator
Posts: 11536
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: While Building Program

Postby doublemax » Tue Oct 10, 2017 4:05 pm

Would I Have To Type Those Code In Command Line And Go "ENTER"
Yes. Make sure to "navigate" to the correct directory first.

In case you don't know how to do that: http://www.colorado.edu/geography/gcraf ... html#chdir
Use the source, Luke!

User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

Re: While Building Program

Postby Chikwado » Tue Oct 24, 2017 3:25 pm

After Installing Codeblock I Use To Create Console Project, Write Code In Codeblock Ide And Click F9 To Compile It Which Work Fine. Now To Compile Wxwidget, I Have Wxwidget In C:\wxwidget, Then In Codeblock, C:\Program Files\codeblock\mingw, I Copy The Folder "mingw" And Paste In "C:\", Now To Run Window Commandline, I Run This Example: cd <MINGW>\bin mingw32-make -v and got this error: The System Cannot Fined The File Specified. There Are Some Source Here.

User avatar
doublemax
Moderator
Moderator
Posts: 11536
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: While Building Program

Postby doublemax » Tue Oct 24, 2017 3:41 pm

I Copy The Folder "mingw" And Paste In "C:\",
This is never a good idea.

Please read what i wrote before:
AFAIK the CB installer does not add the path to MingW to the %PATH% automatically. Open a command window and enter "gcc -v". If it outputs the compiler info, everything is ok so far.

If not, you have to add the path to the compiler (e.g. c:\mingw\bin ) to the %PATH% and restart your system. (Google if you don't know what that means or if you don't know how to do it.)


cd <MINGW>\bin mingw32-make
Wrong again. Please follow the instructions exactly.

If your compiler is found on the command line (see above), navigate to c:\wxWidgets\build\msw\ and then enter the commands from my previous post.
Use the source, Luke!

User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

Re: While Building Program

Postby Chikwado » Mon Nov 06, 2017 7:14 pm

I Need Example On How To Add Path To Compiler, For Example I Took The Following Step As Window 7 User: Start -> Right-click Computer -> Advance System Setting -> Environment Variable -> Click -> Path Click-> Edit -> Add C:\MinGw\bin finally Go Ok-> Ok-> Ok->. Restart. To Test The Compiler, I Enter gcc -v. I got This Error: "gcc -v" is not recognize as internal or external command.

User avatar
doublemax
Moderator
Moderator
Posts: 11536
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: While Building Program

Postby doublemax » Mon Nov 06, 2017 9:16 pm

That sounds exactly right.

In the console window, enter "set PATH". This should display the current content of PATH. Check that the correct path was added. Entries must be separated by a semicolon ";".

If the path is set correctly, check if the path c:\mingw\bin actually exists and if gcc (and lots of other stuff) is in there.

Alternatively you can install MinGW separately. I suggest to use TDM-GCC as it's known to work with wxWidgets.
http://tdm-gcc.tdragon.net/
Use the source, Luke!

User avatar
Chikwado
In need of some credit
In need of some credit
Posts: 8
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria

Re: While Building Program

Postby Chikwado » Tue Nov 07, 2017 8:12 am

Check That The Correct Path Was Added. Entries Must Be Seperated By Semicolon ";"
How Many Path Variable Do I Need There? The Path Variable That I Found There Are: C:\Program Files\Mcrosoft Web Installer, I Added This: C:\MinGw\bin Then, Are There Other Path Variable That I Must Add There? Thanks.


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 3 guests