[SOLVED] Compiling VLCKit

This forum is about all development around libVLC.
KPM
New Cone
New Cone
Posts: 3
Joined: 23 Jul 2009 22:48

[SOLVED] Compiling VLCKit

Postby KPM » 23 Jul 2009 22:55

Hi,

I have been unsuccessfully trying to get the VLCKit framework working, as described in http://wiki.videolan.org/Mac_OS_X_Framework

Code: Select all

$ cd extras/contrib && ./bootstrap && make && cd ../.. && ./bootstrap &&./configure && make && cd projects/macosx/framework && make
Both the one-click build and the Terminal build fail. The latter fails with this message:

Code: Select all

The following build commands failed: vlc-configure: PhaseScriptExecution /Users/kpm/vlc/projects/macosx/framework/build/VLCKit.build/Debug/vlc-configure.build/Script-63FFDBCD0D2AE2AE0092FC96.sh vlc-core: ExternalBuildToolExecution vlc-core (2 failures) make: *** [all] Error 1 Across-the-Universe:framework kpm$
I have been searching for this error on the internet (incl. this forum), found a few people facing the same problem but no one got an answer about it.

How could I fix this bug?
Last edited by KPM on 24 Jul 2009 01:41, edited 2 times in total.

KPM
New Cone
New Cone
Posts: 3
Joined: 23 Jul 2009 22:48

Re: Compiling VLCKit

Postby KPM » 24 Jul 2009 01:23

SOLVED -- I investigated a bit within the makefiles and here's what I discovered.

Actually the problem was not with the framework itself, but with compiling VLC on Mac OS X. Having figured that, I checked http://wiki.videolan.org/OSXCompile and found that you should set a pair of global variables before running ./configure :
$ export CC=/Developer/usr/bin/llvm-gcc-4.2
$ export CXX=/Developer/usr/bin/llvm-g++-4.2
$ export OBJC=/Developer/usr/bin/llvm-gcc-4.2

Without these, make will use the default gcc, which is, on Mac OS X Leopard, gcc-4.0. Yet gcc-4.2 is needed, else build will fail as stated in the bootstrap output:
*****************************************************************
* We are using GCC-4.2 on OS X, so compilation WILL FAIL if it *
* is NOT installed. *
*****************************************************************

So you need to include those three lines between the second ./bootstrap and the ./configure

However this is not enough. Indeed, the last build phase (make in projects/macosx/framework) calls the Xcode project builder, which by default will in turn rebuild everything from the first step, without proper setting of the global variables, thus failing the build.

To circumvent this, do not run the final make but instead after having built the vlc core, open the framework project in Xcode, select VLCKit as the active target, and build.

That's it!

KPM
New Cone
New Cone
Posts: 3
Joined: 23 Jul 2009 22:48

Re: [SOLVED] Compiling VLCKit

Postby KPM » 24 Jul 2009 01:42

http://wiki.videolan.org/Mac_OS_X_Framework updated according to these elements.

einarmagnus
New Cone
New Cone
Posts: 3
Joined: 27 Apr 2009 06:36

Re: [SOLVED] Compiling VLCKit

Postby einarmagnus » 20 Oct 2009 06:07

When I try to follow these instructions the build still fails.
First I got

Code: Select all

Building target “VLCKit” of project “VLCKit” with configuration “Release” — (4 errors) cd /Users/luser/src/vlc/projects/macosx/framework /bin/sh -c /Users/luser/src/vlc/projects/macosx/framework/build/VLCKit.build/Release/VLCKit.build/Script-EF78BD2E0CAEEF9500354E6E.sh Building modules folder... find: /Users/luser/src/vlc/projects/macosx/framework/build/vlc_build_dir/modules: No such file or directory Removing module libmacosx_plugin.dylib rm: /Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/Versions/A/modules/libmacosx_plugin.dylib: No such file or directory Building library folder... Building share folder... Headers not needed for this product find: /Users/luser/src/vlc/projects/macosx/framework/build/vlc_build_dir/modules: No such file or directory rm: /Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/Versions/A/modules/libmacosx_plugin.dylib: No such file or directory cd /Users/luser/src/vlc/projects/macosx/framework setenv MACOSX_DEPLOYMENT_TARGET 10.5 /Developer/usr/bin/llvm-gcc-4.2 -arch i386 -dynamiclib -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/luser/src/vlc/projects/macosx/framework/build/Release -L/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib -F/Users/luser/src/vlc/projects/macosx/framework/build/Release -filelist /Users/luser/src/vlc/projects/macosx/framework/build/VLCKit.build/Release/VLCKit.build/Objects-normal/i386/VLCKit.LinkFileList -install_name @loader_path/../Frameworks/VLCKit.framework/Versions/A/VLCKit -mmacosx-version-min=10.5 -single_module -read_only_relocs suppress -lvlc -dylib_file @loader_path/../lib/vlc_libintl.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/vlc_libintl.dylib -dylib_file @loader_path/lib/libvlc.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/libvlc.dylib -dylib_file @loader_path/../lib/libvlc.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/libvlc.dylib -dylib_file @loader_path/lib/libvlc-control.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/libvlc-control.dylib -framework Cocoa -framework QuartzCore -Wl,-single_module -compatibility_version 1 -current_version 1 -o /Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/Versions/A/VLCKit Undefined symbols: "_libvlc_video_set_deinterlace", referenced from: _-[VLCMediaPlayer setDeinterlaceFilter:enabled:] in VLCMediaPlayer.o "_libvlc_errmsg", referenced from: ___catch_exception in VLCLibrary.o _-[VLCLibrary init] in VLCLibrary.o ld: symbol(s) not found collect2: ld returned 1 exit status "_libvlc_video_set_deinterlace", referenced from: _-[VLCMediaPlayer setDeinterlaceFilter:enabled:] in VLCMediaPlayer.o "_libvlc_errmsg", referenced from: ___catch_exception in VLCLibrary.o _-[VLCLibrary init] in VLCLibrary.o ld: symbol(s) not found collect2: ld returned 1 exit status Build failed (4 errors)
From this it would appear that VLC_BUILD_DIR wasn't set properly so I changed Pre-Compile.sh from

Code: Select all

if test "${ACTION}" = ""; then # Debug -- TARGET_BUILD_DIR="." FULL_PRODUCT_NAME="VLCKit.framework" CONTENTS_FOLDER_PATH="${FULL_PRODUCT_NAME}/Versions/A" VLC_BUILD_DIR="../../.." VLC_SRC_DIR="../../.." ACTION="build" rm -fr ${FULL_PRODUCT_NAME} # Debug -- #etc...
to

Code: Select all

if test "${ACTION}" = "build"; then # Debug -- TARGET_BUILD_DIR="." FULL_PRODUCT_NAME="VLCKit.framework" CONTENTS_FOLDER_PATH="${FULL_PRODUCT_NAME}/Versions/A" VLC_BUILD_DIR="../../.." VLC_SRC_DIR="../../.." ACTION="build" rm -fr ${FULL_PRODUCT_NAME} # Debug -- #etc...
but I still get this error:

Code: Select all

Building target “VLCKit” of project “VLCKit” with configuration “Release” — (2 errors) cd /Users/luser/src/vlc/projects/macosx/framework setenv MACOSX_DEPLOYMENT_TARGET 10.5 /Developer/usr/bin/llvm-gcc-4.2 -arch i386 -dynamiclib -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/luser/src/vlc/projects/macosx/framework/build/Release -L/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib -F/Users/luser/src/vlc/projects/macosx/framework/build/Release -filelist /Users/luser/src/vlc/projects/macosx/framework/build/VLCKit.build/Release/VLCKit.build/Objects-normal/i386/VLCKit.LinkFileList -install_name @loader_path/../Frameworks/VLCKit.framework/Versions/A/VLCKit -mmacosx-version-min=10.5 -single_module -read_only_relocs suppress -lvlc -dylib_file @loader_path/../lib/vlc_libintl.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/vlc_libintl.dylib -dylib_file @loader_path/lib/libvlc.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/libvlc.dylib -dylib_file @loader_path/../lib/libvlc.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/libvlc.dylib -dylib_file @loader_path/lib/libvlc-control.dylib:/Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/lib/libvlc-control.dylib -framework Cocoa -framework QuartzCore -Wl,-single_module -compatibility_version 1 -current_version 1 -o /Users/luser/src/vlc/projects/macosx/framework/build/Release/VLCKit.framework/Versions/A/VLCKit Undefined symbols: "_libvlc_video_set_deinterlace", referenced from: _-[VLCMediaPlayer setDeinterlaceFilter:enabled:] in VLCMediaPlayer.o "_libvlc_errmsg", referenced from: ___catch_exception in VLCLibrary.o _-[VLCLibrary init] in VLCLibrary.o ld: symbol(s) not found collect2: ld returned 1 exit status "_libvlc_video_set_deinterlace", referenced from: _-[VLCMediaPlayer setDeinterlaceFilter:enabled:] in VLCMediaPlayer.o "_libvlc_errmsg", referenced from: ___catch_exception in VLCLibrary.o _-[VLCLibrary init] in VLCLibrary.o ld: symbol(s) not found collect2: ld returned 1 exit status Build failed (2 errors)
Any tips on what I can do?
I'm on OS X 10.5.8 with Xcode 3.1.2 and I have tried both release and debug builds.

marcelerz
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2008 23:04

Re: [SOLVED] Compiling VLCKit

Postby marcelerz » 04 Dec 2009 10:49

Hi!

I found a different way to compile the kit. Here is the way I got it to work:

-Download the head with git by entering following command in the terminal:
> git clone git://git.videolan.org/vlc.git

-Then go to vlc/projects/macosx/framework and open the vlckit project.
-Select as target "vlc-contrib-core-framework" and hit build. This downloads all dependencies and compiles required binaries as the vlc library. To compile the project, you need to have gcc 4.2, otherwise you will get a compiler error. The compiling takes a while and even may throw errors for some binaries which cannot be installed, but it seems not to be required.
-To check if everything works: Select the vlckit as target and hit build. Should compile without any error.

I don't know why the wiki doesn't explain this way; it is much easier than the way they describe it and it even works.

Enjoy your vlc-kit!

Marcel Erz

einarmagnus
New Cone
New Cone
Posts: 3
Joined: 27 Apr 2009 06:36

Re: [SOLVED] Compiling VLCKit

Postby einarmagnus » 05 Dec 2009 08:19

Thank you, worked like a charm! :D :D

Dieter47
New Cone
New Cone
Posts: 1
Joined: 12 Dec 2009 12:20

Re: [SOLVED] Compiling VLCKit

Postby Dieter47 » 12 Dec 2009 12:30

Hello, i try to build the VLCKit Framework and get a failure:

Ld build/Debug/VLCKit.framework/Versions/A/VLCKit normal x86_64
cd /Users/dsand/dev/vlc/projects/macosx/framework
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/llvm-gcc-4.2 -arch x86_64 -dynamiclib -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/dsand/dev/vlc/projects/macosx/framework/build/Debug -L/Users/dsand/dev/vlc/projects/macosx/framework/build/Debug/VLCKit.framework/lib -F/Users/dsand/dev/vlc/projects/macosx/framework/build/Debug -filelist /Users/dsand/dev/vlc/projects/macosx/framework/build/VLCKit.build/Debug/VLCKit.build/Objects-normal/x86_64/VLCKit.LinkFileList -install_name @loader_path/../Frameworks/VLCKit.framework/Versions/A/VLCKit -mmacosx-version-min=10.5 -single_module -read_only_relocs suppress -lvlc -framework Cocoa -framework QuartzCore -single_module -compatibility_version 1 -current_version 1 -o /Users/dsand/dev/vlc/projects/macosx/framework/build/Debug/VLCKit.framework/Versions/A/VLCKit

ld: library not found for -lvlc
collect2: ld returned 1 exit status
Command /Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

i used the step from above...

dstieglitz
New Cone
New Cone
Posts: 4
Joined: 23 Jan 2010 22:09

Re: [SOLVED] Compiling VLCKit

Postby dstieglitz » 26 Jan 2010 00:58

I just did a git pull and found these errors when trying to build:

vlc/projects/macosx/framework/Sources/VLCMedia.m:449: error: too many arguments to function 'libvlc_event_attach'

Indeed, the definition of libvlc_event_attach seems to have changed... I'm not sure how to re-write the method calls, however. Can anyone shed some light?

[UPDATE] nevermind... new git pull solved this.

Dan


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 2 guests