e-lab / torch-toolbox

A collection of snippets and libraries for Torch from e-Lab
https://engineering.purdue.edu/elab/
199 stars 64 forks source link

symbol(s) not found for architecture x86_64 #11

Closed joaovcarvalho closed 8 years ago

joaovcarvalho commented 8 years ago

Hi I am getting this error when trying to compile the Video Decoder tool for Mac OS X Version 10.11.6:

gcc video_decoder.o mpjpeg.o -shared -L/Users/joaocarvalho/torch/install/lib/lua/5.1 -L/Users/joaocarvalho/torch/install/lib -o libvideo_decoder.so -lavutil -lavformat -lavcodec -lswscale -lTH -lluajit -lluaT /usr/local/lib/libjpeg.dylib /usr/local/lib/libpng.dylib Undefined symbols for architecture x86_64: "_avcodec_alloc_frame", referenced from: _video_decoder_init in video_decoder.o _video_decoder_rgb in video_decoder.o _encoderopen in video_decoder.o "_avcodec_free_frame", referenced from: _encoderclose in video_decoder.o "_avcodec_get_frame_defaults", referenced from: _video_decoder_batch_resized in video_decoder.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [libvideo_decoder.so] Error 1

Any idea how to solve this ?

mvitez commented 8 years ago

make NEWFFMPEG=1

joaovcarvalho commented 8 years ago

Same thing:

gcc video_decoder.o mpjpeg.o -shared -L/Users/joaocarvalho/torch/install/lib/lua/5.1 -L/Users/joaocarvalho/torch/install/lib -o libvideo_decoder.so -lavutil -lavformat -lavcodec -lswscale -lTH -lluajit -lluaT /usr/local/lib/libjpeg.dylib /usr/local/lib/libpng.dylib Undefined symbols for architecture x86_64: "_avcodec_alloc_frame", referenced from: _video_decoder_init in video_decoder.o _video_decoder_rgb in video_decoder.o _encoderopen in video_decoder.o "_avcodec_free_frame", referenced from: _encoderclose in video_decoder.o "_avcodec_get_frame_defaults", referenced from: _video_decoder_batch_resized in video_decoder.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [libvideo_decoder.so] Error 1

mvitez commented 8 years ago

make clean before making again with NEWFFMPEG=1

joaovcarvalho commented 8 years ago

Thanks I forgot that, but now the error changed to:

gcc -O3 -c -fpic -Wall -DDARWIN -DNEWFFMPEG -I. -I/Users/joaocarvalho/torch/install/include -I/usr/include/freetype2 livecam.c livecam.c:9:10: fatal error: 'ft2build.h' file not found

include

     ^

1 error generated. make: *\ [livecam.o] Error 1

mvitez commented 8 years ago

There is a missing dependecy in the docs. I will update them. You need libfreetype6-dev, I don't know about Macs.

jhjin commented 8 years ago

if you use homebrew, try this:

brew install freetype
joaovcarvalho commented 8 years ago

Hey thanks for your responses. I runned the brew installation but looks like I already have freetype installed:

brew install freetype Warning: freetype-2.6.5 already installed

joaovcarvalho commented 8 years ago

Maybe it is only the headers files missing ?

mvitez commented 8 years ago

I forgot that livecam does not work on Mac OSX, as it does not implement OpenGL initialization for OSX. So freetype won't be your major problem. Just remove it from the all: line in the Makefile.

joaovcarvalho commented 8 years ago

That worked just fine and I won't use livecam. Thank you so much.