ld: library not found for -lwx_osx_cocoau_core-3.2

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
40kspacemartian
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Mar 30, 2023 3:55 pm

ld: library not found for -lwx_osx_cocoau_core-3.2

Post by 40kspacemartian »

Environment:
macOS (Ventura 13.0)
Apple M2 Pro (ARM, not Intel)
Apple clang version: 14.0.0 (clang-1400.0.29.202)
Clang Target: arm64-apple-darwin22.1.0

I'm developing a Chess game with C++. Instead of using Terminal as the UI, I'd like to a UI framework, such as wxWidgets. From the GitHub repo (https://github.com/wxWidgets/wxWidgets), I navigate to docs/osx/install.md (https://github.com/wxWidgets/wxWidgets/ ... install.md).

I have Xcode downloaded, but I don't want to use it. My IDE is Visual Studio Code. However, to install/setup wxWidgets, I'm just using the Terminal. I download the wxWidgets source code (https://github.com/wxWidgets/wxWidgets/ ... .1.tar.bz2), as specified here (https://www.wxwidgets.org/downloads/). I unpack it on my Desktop, change directory into wxWidgets-3.2.2.1 with Terminal.

Per the install.md instructions, I run the following 4 commands:
mkdir build-cocoa-debug
cd build-cocoa-debug
../configure --enable-debug
make

After installing (brew install) libtiff, I no longer receive a missing error with tiff.h. However, when I run the following commands:
cd samples;
make;

I receive the attached error. Linker command failed. I can't even see on the clang docs that "-lwx_osx_cocoau_core-3.2" is an official/supported flag. Can anyone assist?
Attachments
ld-error.txt
(1.46 KiB) Downloaded 17 times
40kspacemartian
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Mar 30, 2023 3:55 pm

Re: ld: library not found for -lwx_osx_cocoau_core-3.2

Post by 40kspacemartian »

Please disregard. For my 3rd command, I ran it with this adjustment: ../configure --enable-debug CXXFLAGS="-I/opt/homebrew/include"

Then I ran make.

Then ran:
cd samples; make;cd ..
cd demos; make;cd ..


Things are working now. I'm able to change directory into build-cocoa-debug/demos/bombs and run ./bombs, among other demos.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: ld: library not found for -lwx_osx_cocoau_core-3.2

Post by ONEEYEMAN »

Hi,
Was there any errors givenm to you during the compilation or configuring process?
Did you by chance ran "configure and/or make as root?
If you do this:

Code: Select all

cd wxWidgets-3.2.2.1\build-cocoa-debug
./wx-config --cxxflags
./wx-config --libs
do you see any meaningful output?
(Please run it as a regular user and NOT as root).

Also, it is very easy to copt'n'paste the error from the Terminal into the post.
Please try to not use attachment.

We don't know what do you have on your system and opening the attachment is very scary.

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: ld: library not found for -lwx_osx_cocoau_core-3.2

Post by ONEEYEMAN »

Hi,
This is strnge.
You shuoldn't supply any additional CXX options to configure.

Is it because you manually installed tiff from the homebrew (maybe)?

Try to run (for the test):

Code: Select all

../configure --enable-debug --with-tiff=builtin && make
Check possible values byu running:

Code: Select all

../configure --help | grep tiff
Thank you.
ebyrob
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Sep 28, 2016 8:27 pm

Re: ld: library not found for -lwx_osx_cocoau_core-3.2

Post by ebyrob »

I don't know if this might help anyone but this thread did help me...

I got this exact error message when I somehow forgot to run top-level "make" after "../configure":

ld: library not found for -lwx_osx_cocoau_core-3.2

So, it looks like wx_osx_cocoau_core-3.2.dylib is the first library imported by the samples and demos. If you are like me and totally forgot to run "make" or EVERYTHING is broken for some other reason, maybe knowing you don't have any libraries at all can help.
Operating System: Windows 1-, 64-bit / macOS 13.4.1, Apple M1
Compiler: Visual Studio 2019 / Xcode 14.3.1
wxWidgets version: 3.1.0 / 3.2.2
Post Reply