Fix compilation for plugins but miss RetroShare-gui library linking.

Get ld: symbol(s) not found for architecture ...
This commit is contained in:
Phenom 2015-12-24 18:54:45 +01:00
parent 3ea2e0f450
commit cb4579e8c7
5 changed files with 85 additions and 1 deletions

View file

@ -16,7 +16,7 @@ MOBILITY = multimedia
DEPENDPATH += ../../retroshare-gui/src/temp/ui ../../libretroshare/src
INCLUDEPATH += ../../retroshare-gui/src/temp/ui ../../libretroshare/src
#################################### Windows #####################################
#################################### Linux #####################################
linux-* {
CONFIG += link_pkgconfig
@ -28,6 +28,8 @@ linux-* {
LIBS += -lspeex -lspeexdsp -lavcodec -lavutil
}
#################################### Windows #####################################
win32 {
DEPENDPATH += . $$INC_DIR
@ -78,6 +80,41 @@ win32 {
LIBS += -lavifil32 -lavicap32 -lavcodec -lavutil -lswresample
}
#################################### MacOSX #####################################
macx {
DEPENDPATH += . $$INC_DIR
INCLUDEPATH += . $$INC_DIR
#OPENCV_VERSION = "249"
USE_PRECOMPILED_LIBS =
for(lib, LIB_DIR) {
#message(Scanning $$lib)
exists( $$lib/opencv/libopencv_core*.dylib) {
isEmpty(USE_PRECOMPILED_LIBS) {
message(Get pre-compiled opencv libraries here:)
message($$lib)
LIBS += -L"$$lib/opencv"
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc
USE_PRECOMPILED_LIBS = 1
}
}
exists( $$lib/libopencv_videoio*.dylib) {
message(videoio found in opencv libraries.)
message($$lib)
LIBS += -lopencv_videoio
}
}
isEmpty(USE_PRECOMPILED_LIBS) {
message(Use system opencv libraries.)
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc
}
error(Missing RetroShare-gui library. Remove Plugins from RetroShare.pro))
}
# ffmpeg (and libavutil: https://github.com/ffms/ffms2/issues/11)
QMAKE_CXXFLAGS += -D__STDC_CONSTANT_MACROS

View file

@ -1,6 +1,10 @@
#include <iostream>
#include <assert.h>
#ifdef __MACH__
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
#include <QByteArray>
#include <QBuffer>
@ -720,7 +724,12 @@ bool FFmpegVideo::decodeData(const RsVOIPDataChunk& chunk,QImage& image)
#if defined(__MINGW32__)
unsigned char *tmp = (unsigned char*)_aligned_malloc(s + AV_INPUT_BUFFER_PADDING_SIZE, 16) ;
#else
#ifdef __MACH__
//Mac OS X appears to be 16-byte mem aligned.
unsigned char *tmp = (unsigned char*)malloc(s + AV_INPUT_BUFFER_PADDING_SIZE) ;
#else //MAC
unsigned char *tmp = (unsigned char*)memalign(16, s + AV_INPUT_BUFFER_PADDING_SIZE) ;
#endif //MAC
#endif //MINGW
if (tmp == NULL) {
std::cerr << "FFmpegVideo::decodeData() Unable to allocate new buffer of size " << s << std::endl;