Problem configuring wxWidgets in MacOS

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
EOS
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Mar 28, 2021 3:50 pm

Problem configuring wxWidgets in MacOS

Post by EOS »

Hi, I am having trouble installing wxWidgets. Sort of a newbie here. I tried following this guide: viewtopic.php?f=19&t=45837, but something is not right. It appears that wx-config never gets installed. I have macOS Big Sur 11.2.2 and I downloaded wxWidgets 3.1.4. I also have Xcode 12.4 (but as you can see below, I never got far enough for that).

On step 3, WxWidgets seems to have been built successfully. After I configure (" ../configure --enable-debug --enable-unicode --with-osx_cocoa --with-macosx-version-min=11.0 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk") there were no errors or warnings.

After "make -j 4" there were no errors / warnings either. Same thing with samples ("cd samples; make; cd .."). I did get 2 warnings when I built the demos ("cd demos; make; cd ..") :
2 warnings:
../../../demos/forty/scoredg.h:27:16: warning: private field 'm_scoreFile' is not used [-Wunused-private-field]
ScoreFile* m_scoreFile;
../../../demos/forty/scoredg.h:28:15: warning: private field 'm_OK' is not used [-Wunused-private-field]
wxButton* m_OK;
ON STEP 4 is where I see something is wrong because when I execute "locate wx-config" nothing is returned at all. And "which wx-config" returns the error: "wx-config not found".

Any idea what the problem is? When I go to where wxWidgets is built, in the "build-cocoa-debug" folder I created as part of step 3, there is a "wx-config" reference that points to a "inplace-osx_cocoa-unicode-3.1" file in a different subfolder. Don't know if that sheds any light.

Any help would be greatly appreciated.
Thanks
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Problem configuring wxWidgets in MacOS

Post by ONEEYEMAN »

Hi,
From step 4:

Code: Select all

locate wx-config (shows all versions if installed)
As you followed that post, I presume you didn't run:

Code: Select all

make install
NOTE: You don't have to install wxWidgets. It is just for convenience.

In order to continue you should adjust the command to be:

Code: Select all

/path/to/wxWidgets/build/directory/wx-config --libs
That directory is where you ran the configure from.

Running make install installs the library, but on Mac it may interfere with the wxWidgets that is already installed by OS or any other software that uses the library.

Thank you.
EOS
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Mar 28, 2021 3:50 pm

Re: Problem configuring wxWidgets in MacOS

Post by EOS »

Thanks for the response. You are right, I did not do

Code: Select all

make install
I tried to follow your suggestion, but when I go to

Code: Select all

 / ... /wxWidgets/build 
there is no "directory" folder? I see in the directory from where I ran configure a "wx-config.in" and a "wx-config-inplace.in" but after searching my entire computer, it is apparent that wx-config was just never installed. So weird. Maybe I should just delete everything and re-install with brew?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Problem configuring wxWidgets in MacOS

Post by ONEEYEMAN »

Hi,
You don't have to install wxWidgets!!

As I said before - this will make working with different versions of the library much harder.

Just follow my instructions below:

Code: Select all

cd ~/wxWidgets/buildMac
./wx-config --cxxflags
./wx-config --libs
that is if you unpack wxWidgets into the "~/wxWidgets" directory and then ran configure from the directory called "buildMac".

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problem configuring wxWidgets in MacOS

Post by doublemax »

You were not supposed to take "directory" as a literal directory name. Replace this with the directory you created for a specific build/configuration, e.g. in the post you linked ( viewtopic.php?f=19&t=45837 ), that was "build-cocoa-osx"
Use the source, Luke!
Post Reply