OSX Trying to compile library Topic is solved

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
johnth1957
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2018 12:13 am

OSX Trying to compile library

Post by johnth1957 »

wxwidgets 3.1
osx sierra 10.12.5

Hope someone can shed some light, been fighting this for days, trying to compile the wxwidgets on osx.

I updated my mediactrl.mm file from GitHub because of the qtkit issue. Is there another file I need to update?

it all compiles fine but getting the link error below:


Undefined symbols for architecture i386:
".objc_class_name_AVAsset", referenced from:
pointer-to-literal-objc-class-name in mediadll_osx_cocoa_mediactrl.o
".objc_class_name_AVPlayer", referenced from:
.objc_class_name_wxAVPlayer in mediadll_osx_cocoa_mediactrl.o
".objc_class_name_AVPlayerItem", referenced from:
pointer-to-literal-objc-class-name in mediadll_osx_cocoa_mediactrl.o
".objc_class_name_AVPlayerLayer", referenced from:
pointer-to-literal-objc-class-name in mediadll_osx_cocoa_mediactrl.o
"_AVPlayerItemDidPlayToEndTimeNotification", referenced from:
-[wxAVPlayer observeValueForKeyPath:ofObject:change:context:] in mediadll_osx_cocoa_mediactrl.o
"_CMTimeGetSeconds", referenced from:
wxAVMediaBackend::GetPosition() in mediadll_osx_cocoa_mediactrl.o
wxAVMediaBackend::GetDuration() in mediadll_osx_cocoa_mediactrl.o
"_CMTimeMakeWithSeconds", referenced from:
wxAVMediaBackend::SetPosition(wxLongLongNative) in mediadll_osx_cocoa_mediactrl.o
"_kCMTimeZero", referenced from:
wxAVMediaBackend::Stop() in mediadll_osx_cocoa_mediactrl.o
wxAVMediaBackend::SetPosition(wxLongLongNative) in mediadll_osx_cocoa_mediactrl.o
ld: symbol(s) not found for architecture i386

Configuration I used below: note that I've tried the 86_64 architecture also with same result.

../configure --with-osx_cocoa --with-macosx-version-min=10.9 --enable-mediactrl --enable-universal-binary=i386
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: OSX Trying to compile library

Post by ONEEYEMAN »

Hi,
I'm not an OSX expert, but I think the problem comes from the "i386" parameter.

Can you try to configure without (at least for testing purposes)?

Thank you.
johnth1957
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2018 12:13 am

Re: OSX Trying to compile library

Post by johnth1957 »

same issue. Am I supposed to be linking to another library (av library) with the upgrade since qtkit is not there now?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: OSX Trying to compile library

Post by ONEEYEMAN »

Hi,
Do you need a media control library in your application?

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

Re: OSX Trying to compile library

Post by doublemax »

Maybe try the latest version from GIT?

I usually don't work on OSX, but i finally managed to get a Sierra 10.12 to run in VMware. I downloaded the latest wxWidgets version through GIT and building was successful on the first try.

In detail:
- open a terminal window (Applications -> Utilities -> Terminal)
- type "gcc -v" (without the quotes)
this is just to check if gcc is installed. If not, it will ask you if you want to install the developer command line tools, just click "install" then

- get wxWidgets from GIT with this command (this will take a while depending on your internet speed)
git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets.git

cd wxWidgets
mkdir build-debug
cd build-debug
../configure --disable-shared
( you may choose other options, but try with the simplest configuration first )
when it's done:
make -j4

If everything was successful, try building the "minimal" sample that comes with wxWidgets:
cd samples/minimal
make
./minimal
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: OSX Trying to compile library

Post by ONEEYEMAN »

doublemax,
The last command in your instructions should be:

Code: Select all

open minimal.app
In OSX everything is created as a bundle. An executable is created and then set up as part of the bundle.
In order to run the bundle you use aforementioned command.

Now the minimal.app is just a directory. You can enter a directory and then find the actual binary. But when you try to run them you won't be able to set focus to the application.

Thought I educate you a little on the unfamiliar environment. ;-)

Also "make -j4" should really depend on how many processors the hardware does have.

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

Re: OSX Trying to compile library

Post by doublemax »

In OSX everything is created as a bundle. An executable is created and then set up as part of the bundle.
In order to run the bundle you use aforementioned command.
Thanks, i actually knew that. But just running the "app" directly worked fine for me. Even more complex samples. They didn't have the "can't focus app" problem.
Also "make -j4" should really depend on how many processors the hardware does have.
I knew that too, but as it was supposed to be a simple step-through, i wanted to keep it as short as possible. And -j4 is a good compromise, i don't think there are any Macs with less than 4 cores (or are there?).
Use the source, Luke!
johnth1957
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2018 12:13 am

Re: OSX Trying to compile library

Post by johnth1957 »

Doublemax that worked! Thanks for the help! Your the man!
johnth1957
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2018 12:13 am

Re: OSX Trying to compile library

Post by johnth1957 »

Very new to mac sorry for the probably simple issues.
Hi, compiled fine but when i try to run the make on minimal I get the following:

make -f makefile.gcc
if not exist gcc_mswud mkdir gcc_mswud
make: -c: No such file or directory
make: [gcc_mswud] Error 1 (ignored)
windres --use-temp-file -i../../samples/sample.rc -ogcc_mswud\minimal_sample_rc.o --define __WXMSW__ --define _UNICODE --include-dir .\..\..\lib\gcc_lib\mswud --include-dir ./../../include --include-dir . --include-dir ./../../samples --define NOPCH
make: -c: No such file or directory
make: *** [gcc_mswud\minimal_sample_rc.o] Error 1
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: OSX Trying to compile library

Post by ONEEYEMAN »

Hi,
Just "make" will do. :-)

Thank you.
johnth1957
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2018 12:13 am

Re: OSX Trying to compile library

Post by johnth1957 »

This is just what make returns.

make: *** No targets specified and no makefile found. Stop.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: OSX Trying to compile library

Post by ONEEYEMAN »

Hi,
In the directory where you run "configure" from, do this:

Code: Select all

cd samples/minimal
make
Don't do it from the wxWidgets/samples/minimal, where you tried it from.

Thank you.
johnth1957
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2018 12:13 am

Re: OSX Trying to compile library

Post by johnth1957 »

Thanks! That worked!
Post Reply