How to compile 3.1.2 for Code::Blocks in OSX 10.14

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Krice
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 14, 2019 12:32 pm

How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by Krice » Wed Aug 14, 2019 12:59 pm

Wx seems to compile ok with these configure settings, which by the way I found from internet:

../configure --enable-debug --enable-monolithic --with-osx_cocoa --with-macosx-version-min=10.9

I think monolithic is needed for Code::Blocks. Make also appears to work (it's compiling everything), but when I try to run ./bootstrap (part of Code::Blocks source code release) I get this error:

configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:142: error: possibly undefined macro: AM_PATH_WXCONFIG

Internet search tells this is a somewhat common problem and the solution seems to be this:

export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"

However this doesn't work, because wx-config is not found. I'm new to osx programming so I have no idea what is going on. Code::Blocks seems to require 3.1.1 but it can't be the reason, can it?

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

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by ONEEYEMAN » Wed Aug 14, 2019 2:30 pm

Hi,
Krice wrote:
Wed Aug 14, 2019 12:59 pm
Wx seems to compile ok with these configure settings, which by the way I found from internet:

../configure --enable-debug --enable-monolithic --with-osx_cocoa --with-macosx-version-min=10.9

I think monolithic is needed for Code::Blocks. Make also appears to work (it's compiling everything), but when I try to run ./bootstrap (part of Code::Blocks source code release) I get this error:
This configure line looks fine.
I would remove "--enable-monolithic" as it does notr required in any way and may cause trouble in the long run.

No, idea why you said its required for C::B.
Krice wrote:
Wed Aug 14, 2019 12:59 pm
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:142: error: possibly undefined macro: AM_PATH_WXCONFIG

Internet search tells this is a somewhat common problem and the solution seems to be this:

export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"

However this doesn't work, because wx-config is not found. I'm new to osx programming so I have no idea what is going on. Code::Blocks seems to require 3.1.1 but it can't be the reason, can it?
If configure and make were successful, you shuld have a successful build.

Try to do this:

Code: Select all

cd wxWidgets-3.1.2/buildMac/sample/minimal && make && open minimal.app
That should build minimal sample and execute it.

If everything is successful than you shuold be OK.

But as I said - remove the monolithic option from configure line, re-run configure and make in the new build directory.

Then try to attach a new build to C::B.

If that fails post here the error.

Thank you.

Krice
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 14, 2019 12:32 pm

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by Krice » Thu Aug 15, 2019 6:35 am

The minimal example builds and runs fine, so the "problem" is in Code::Blocks configure script I think. It wants to use wx-config, but it can't find it. I can't find it either. There is an alias wx-config file in build directory, but it doesn't run. Also, I'm wondering if Code::Blocks requires "system wide" install with 'make install'?

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

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by ONEEYEMAN » Thu Aug 15, 2019 12:05 pm

Hi,
Can you post the results of:

Code: Select all

cd wxWidgets-3.1.2/buildMac && ./wx-config --version
and

Code: Select all

cd wxWidgets-3.1.2/buildMac && ls -la wx-config*
?

Thank you.

Krice
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 14, 2019 12:32 pm

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by Krice » Fri Aug 16, 2019 12:53 pm

It didn't find wx-config, because I thought commands are run with only the name, but it has to be ./wx-config so that was something new. The version returns 3.1.2. I don't have problems with wxWidgets itself, but Code::Blocks (./bootstrap in install) doesn't find it. For example it's trying to find /share/aclocal directory from wxWidgets directory, but there is no such directory.

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

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by ONEEYEMAN » Fri Aug 16, 2019 2:00 pm

Hi,
You should probably ask this question on the C::B forum, unless someone chime in in the next couple of hours.

Thank you.

Krice
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 14, 2019 12:32 pm

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by Krice » Sat Aug 17, 2019 12:49 pm

I have asked it in Code::Blocks forums and those guys are already quite mad about it. They say I should 'make install' wxwidgets, but the install instructions of wxwidgets say only 'make'. Which one is it? When is the library actually installed? I can compile and run the example, but I guess it's not installed.

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

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by ONEEYEMAN » Sat Aug 17, 2019 5:17 pm

Hi,
You dont have to install anything.
However it looks C::B requires it to be installed.

Run

Code: Select all

sudo make install
and try again.

Just know - C::B is wrong here and it should pick up ex whether it is installed or not.

Thank you.

Krice
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 14, 2019 12:32 pm

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by Krice » Mon Aug 19, 2019 7:00 am

With 'sudo make install' I got ./bootstrap to work finally, but when I try to run ./configure for Code::Blocks it stops to an error message about some package missing. This was again something to ask in Code::Blocks forums if those guys would be willing to help, which they aren't. So I have to keep searching the internet about this when I have the time for that, luckily I have more important things to do. It would help if there was another Apple owner trying to compile Code::Blocks and tell how it actually works, because it seems it simply doesn't work when following build instructions.

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

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by ONEEYEMAN » Mon Aug 19, 2019 7:38 am

Hi,
Just install Xcode and forget about that. Will be much simpler. ;-)

But seriously - what error message did you get? Can you post the output from the Terminal?

Thank you.

Krice
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 14, 2019 12:32 pm

Re: How to compile 3.1.2 for Code::Blocks in OSX 10.14

Post by Krice » Mon Aug 19, 2019 3:47 pm

Package 'hunspell' was missing, but it was easy to install with homebrew (like most other things as well). So after all this Code::Blocks builds and works, more or less.

Post Reply