Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

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.
Feelings
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 28, 2020 11:17 am

Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings » Sun Jun 28, 2020 11:33 am

Hello everyone. I am trying compile wxWidgets project in Code::Blocks. I am read some similar topics here and maybe problem is that code blocks cant fine some libraries. I want set global variable wx but I event can't get this window:

Image

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4232
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN » Sun Jun 28, 2020 4:13 pm

Hi,
There was a very recent post on the forum on how to make C::B work with the library. Did you see it and follow through?

Thank you.

Feelings
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings » Sun Jun 28, 2020 5:36 pm

Yes, I saw some topics before. For example I follow these instructions:
viewtopic.php?f=19&t=47061 ... and I stopped at point ...
"Open Code::Blocks and start a new project. When it asks for the project type, scroll down to the bottom and select the wxWidgets icon."
and then I create project but when I want compile I still have errors

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

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by doublemax » Sun Jun 28, 2020 6:11 pm

I am trying compile wxWidgets project in Code::Blocks
I'm not sure if this is just bad wording, but you can't build wxWidgets itself in Code:Blocks. Before you get into CB, you need to build wxWidgets itself from the command line, instructions for that should be in the CB tutorials you mentioned.

Then you can create a new wxWidgets project in CB. Here it's important that the options you choose match the choices you mad when building wxWidgets itself (mainly if you use static or dynamic linking, or if you use a monolithic build or not). Again, these is all explained the the tutorials here: viewtopic.php?f=19&t=47233

Also: What exact errors do you get and and what stage?
Use the source, Luke!

Feelings
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings » Sun Jun 28, 2020 7:24 pm

Yes, I built wxWidgets itself in Code::Blocks from command line wrtite it these instructions:
cd C:\wxWidgets-3.1.3\build\msw
mingw32-make -f makefile.gcc clean
mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=1UNICODE=1
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1UNICODE=1

Then I create project following these instructions :

Next screen: select wxWidgets 3.1.x
Next screen: give a project name
Next screen: author, but not required
Next screen: select wxFormBuilder and Frame Based
Next screen: enter location for wxWidgets (for me C:\wxWidgets-3.1.3).
Next screen: default should have GNU GCC Complier with compiler and debugger checked. Leave.
Next screen: select Enable Unicode. Leave the rest unchecked.
Next screen: leave features unselected for this test build. Select Finish.

When I try compile I got errors.. for example "wx/app.h: No such file or directory" in App.h or "can not find -lwxmsw3_ludcore" and "can not find -lwxbase2lud" in Main.h

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4232
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN » Sun Jun 28, 2020 7:32 pm

Hi,
First of all

Please do this:

Code: Select all

cd C:\wxWidgets-3.1.3\build\msw
mingw32-make -f makefile.gcc clean
mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=0 UNICODE=1
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=0 UNICODE=1
/code]

A note - monolithic build, while supported, is a hassle and might give problem in the long run. It is best to avoid them.
Also, you don't have to specify "UNICODE" option as it is on by default. I left it for consistency.

Now, back to C::B

[code]
Next screen: select wxWidgets 3.1.x
Next screen: give a project name
Next screen: author, but not required
Next screen: select wxFormBuilder and Frame Based
Next screen: enter location for wxWidgets (for me C:\wxWidgets-3.1.3).
Next screen: default should have GNU GCC Complier with compiler and debugger checked. Leave.
Next screen: select Enable Unicode. Leave the rest unchecked.
Next screen: leave features unselected for this test build. Select Finish.
Looks good, except you will need to unselect the "Build wx as Monolithic library" option.
Don't know where it is - not using C::B.

After you do all this and perform the build , and if you still have error(s) - please post it exactly as it appears in the "Build Log". VERBATIM!

Thank you.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4232
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN » Sun Jun 28, 2020 7:34 pm

2doublemax,
Since you are the moderator - could make a recent post from PB about C::B sticky, so that it can be easily referenced and found by people.

I'd ask him to make this post on the C::B forum as well, but it just night be too much. ;-)

Thank you.

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

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by doublemax » Sun Jun 28, 2020 7:42 pm

ONEEYEMAN wrote:
Sun Jun 28, 2020 7:34 pm
Since you are the moderator - could make a recent post from PB about C::B sticky, so that it can be easily referenced and found by people.
We currently have 3 CB tutorials made by users on this forum. As i didn't want to have 3 sticky threads and i also didn't want to favor one of them, they are all combined in one sticky thread:
viewtopic.php?f=19&t=47233
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4232
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN » Sun Jun 28, 2020 7:47 pm

doublemax,
Thank you.

Now, if only people stop going to some arbitrary web content and try to stick with "official" tutorial... ;-)

Feelings
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings » Sun Jun 28, 2020 9:12 pm

Image
Looks good, except you will need to unselect the "Build wx as Monolithic library" option.
I select "Enable Unicode " and "Build wx as Monolithic library" and I get a lot of errors

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4232
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN » Sun Jun 28, 2020 9:18 pm

Hi,
You need to UN-select "Build wx as Monolithic library".

Because you didn't build it as monolithic - this is the common sense. ;-)

Now, when you get an error - please post an error as it appears in the Build Log.
DO NOT SAY "I get an error like...". Just copy and paste an exact line with the error.

We can't guess what error is given to you and where.

Thank you.

Feelings
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 28, 2020 11:17 am

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by Feelings » Sun Jun 28, 2020 9:27 pm

Hi,
This option was unselected so I select only "Enable Unicode" option.

I got two errors:

ld.exe cannot find -lwxmsw31ud_core
ld.exe cannot find -lwxbase31ud

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4232
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN » Sun Jun 28, 2020 10:05 pm

Hi,
Can you find those 2 files in the wxWidgets folder?

Or even better - do this:

Code: Select all

cd C:\wxWidgets-3.1.3\samples\minimal
mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=0 UNICODE=1
./minimal.exe
Please post any error(s) you receive here.

Thank you.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by stahta01 » Sun Jun 28, 2020 10:52 pm

You two do realize that one is using "MONOLITHIC=0" and the other is using "MONOLITHIC=1", right?

I suggest you both decide which one is being used!!

Edit: I have never been able to switch the value of MONOLITHIC without a full delete of the wxWidgets folder and extract a fresh copy of files.

Tim S.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4232
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Creating wxWidgets 3.1.3 project in Code::Blocks: No such file or directory

Post by ONEEYEMAN » Sun Jun 28, 2020 11:27 pm

Tim,
My instruction was clear - delete and then build with MONOLITHIC=0.

I guess (s)he didn't follow...

Thank you.

Post Reply