Page 1 of 1

[SOLVED] Compiling VLCKit

Posted: 23 Jul 2009 22:55
by KPM
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?

Re: Compiling VLCKit

Posted: 24 Jul 2009 01:23
by KPM
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!

Re: [SOLVED] Compiling VLCKit

Posted: 24 Jul 2009 01:42
by KPM
http://wiki.videolan.org/Mac_OS_X_Framework updated according to these elements.

Re: [SOLVED] Compiling VLCKit

Posted: 20 Oct 2009 06:07
by einarmagnus
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.

Re: [SOLVED] Compiling VLCKit

Posted: 04 Dec 2009 10:49
by marcelerz
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

Re: [SOLVED] Compiling VLCKit

Posted: 05 Dec 2009 08:19
by einarmagnus
Thank you, worked like a charm! :D :D

Re: [SOLVED] Compiling VLCKit

Posted: 12 Dec 2009 12:30
by Dieter47
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...

Re: [SOLVED] Compiling VLCKit

Posted: 26 Jan 2010 00:58
by dstieglitz
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