Android Studio - linker error wih native library SDL_mixer - c++

When I try to build my project, I get errors now. I didn't change a thing and I was under the impression, that it did build a few years ago.
Can you please assist?
The error message is:
C/C++: ld: error: C:\Users\gf\Documents\GLBasic\TwinTris\distribute\android_studio\app\build\intermediates\cxx\Debug\5e641jm3/obj/local/arm64-v8a/objs-debug/main/glbasic/lib_glbasic.o: unable to find library from dependent library specifier: SDL.lib
C/C++: ld: error: C:\Users\gf\Documents\GLBasic\TwinTris\distribute\android_studio\app\build\intermediates\cxx\Debug\5e641jm3/obj/local/arm64-v8a/objs-debug/main/glbasic/lib_glbasic.o: unable to find library from dependent library specifier: SDL_mixer.lib
C/C++: ld: error: C:\Users\gf\Documents\GLBasic\TwinTris\distribute\android_studio\app\build\intermediates\cxx\Debug\5e641jm3/obj/local/arm64-v8a/objs-debug/main/glbasic/lib_glbasic.o: unable to find library from dependent library specifier: SDLmain.lib
C/C++: ld: error: C:\Users\gf\Documents\GLBasic\TwinTris\distribute\android_studio\app\build\intermediates\cxx\Debug\5e641jm3/obj/local/arm64-v8a/objs-debug/main/glbasic/lib_glbasic.o: unable to find library from dependent library specifier: SDL_mixer.lib
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
C/C++: make: *** [C:/Users/gf/AppData/Local/Android/Sdk/ndk/23.1.7779620/build//../build/core/build-binary.mk:715: C:\Users\gf\Documents\GLBasic\TwinTris\distribute\android_studio\app\build\intermediates\cxx\Debug\5e641jm3/obj/local/arm64-v8a/libmain.so] Error 1
C/C++: ld: error: C:\Users\gf\Documents\GLBasic\TwinTris\distribute\android_studio\app\build\intermediates\cxx\Debug\5e641jm3/obj/local/arm64-v8a/objs-debug/main/glbasic/lib_glbasic.o: unable to find library from dependent library specifier: SDL_mixer.lib
You can find the project at:
https://www.glbasic.com/beta/twintris_as.7z

Related

Make error library not found for -lstdc++fs

When compiling code examples from a textbook, I run into a compilation error: ld: library not found for -lstdc++fs. What does this error mean and how can I get around it?
% make filesystem
Consolidate compiler generated dependencies of target filesystem
[100%] Linking CXX executable filesystem
ld: library not found for -lstdc++fs
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [chapter_17/filesystem] Error 1
make[2]: *** [chapter_17/CMakeFiles/filesystem.dir/all] Error 2
make[1]: *** [chapter_17/CMakeFiles/filesystem.dir/rule] Error 2
make: *** [filesystem] Error 2
In short, linking stdc++fs is not longer necessary as it has been incorporated into the base library.
When the textbook was first written the C++ libraries didn't officially support filesystem yet, so they would require a secondary library called stdc++fs. This was a libstdc++ specific library that imported the C++17 features that weren't in the official library yet.
Now, both GCC's libstdc++ and Clang's libc++ include it in their base library, and the stdc++fs library got dropped.
You can drop the linking to that library without any problems; it patched a problem in compiler support that's no longer relevant

Incompatible architectures when linking to static library on iOS Simulator using Qt

while building my Qt project, an iOS app, I'm getting a symbols not found error for a missing architecture (i386).
The project uses subdirs which again contain 2 self written libraries and an app which links to them.
After some investigating I found out that my libraries use armv7 and arm64 while my app uses i386. What I'm getting from this is that the linker doesn't seem to find the libraries with their respective architectures.
This is what I get from the compiler while building:
ld: warning: ld: warning: ignoring file /Users/me/myprojects/build-myproject-iphonesimulator_clang_Qt_5_7_1_for_iOS-Release/install/lib/libwebdav.a, missing required architecture i386 in file /Users/me/myprojects/build-myproject-iphonesimulator_clang_Qt_5_7_1_for_iOS-Release/install/lib/libwebdav.a (2 slices)ignoring file /Users/me/myprojects/build-myproject-iphonesimulator_clang_Qt_5_7_1_for_iOS-Release/install/lib/libcommon.a, missing required architecture i386 in file /Users/me/myprojects/build-myproject-iphonesimulator_clang_Qt_5_7_1_for_iOS-Release/install/lib/libcommon.a (2 slices)
Undefined symbols for architecture i386:
"CalendarEvent::staticMetaObject", referenced from:
qt_meta_extradata_QMLEventWrapper in moc_qmleventwrapper.o
int qRegisterMetaType(char const*, CalendarEvent::APM_TYPE*, QtPrivate::MetaTypeDefinedHelper::Defined) && (!(QMetaTypeId2::IsBuiltIn))>::DefinedType) in moc_qmleventwrapper.o
"CalendarEvent::colorHex() const", referenced from:
QMLEventWrapper::color() const in qmleventwrapper.o
...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...
** BUILD FAILED **
The following build commands failed:
Ld myproject.build/Release-iphonesimulator/myproject.build/Objects-normal/i386/myproject normal i386
(1 failure)
make[1]: * [xcodebuild-release-iphonesimulator] Error 65
make: * [sub-app-make_first] Error 2
Thanks in advance
You are trying to run it on an simulator, which supports architectures i386/x86_64 (the processor of your computer).
Workaround:
Test on a device instead of the simulator
Solution:
Build all used libraries for i386/x86_64 also.
Turned out it was a bug in qmake.
In a very desperate attempt I installed Qt 5.8.0 and tried compiling again. Worked like a charm.
I was using Qt 5.7.1 before which tried to build the libraries for the iPhone instead of the simulator resulting in the wrong architecture.
See https://bugreports.qt.io/browse/QTBUG-58007

OpenGL XCode8 Linking Error

I have a problem building my OpenGL project.
I'm getting the following error.
ld: file not found: /usr/lib/system/libsystem_stats.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have "Other Linker Flags" set to "-lGLEW"
I think this somehow fixed my problem :D
static variable link error
The problem i wasn't define the static fields in the translation file.

Setting up Vimeo SDK in iOS

Trying to incorporate Vimeo SDK from github into my iOS project.
Xcode 7.3.1
I have cocoa pods installed and my TestVimeo1 project setup but when I attempt target VIMNetworking, AFNetworking and VIMObjectMapper I must not be going about this correct.
ld: warning: directory not found for option '-L/Users/xxxxx/xcodebuild/_buildoutput/TestVimeo1-fktedyrxeulxmicndbpgghnbdjtn/Build/Products/Debug-iphonesimulator/AFNetworking'
ld: warning: directory not found for option '-L/Users/xxxxx/xcodebuild/_buildoutput/TestVimeo1-fktedyrxeulxmicndbpgghnbdjtn/Build/Products/Debug-iphonesimulator/VIMNetworking'
ld: warning: directory not found for option '-L/Users/xxxxx/xcodebuild/_buildoutput/TestVimeo1-fktedyrxeulxmicndbpgghnbdjtn/Build/Products/Debug-iphonesimulator/VIMObjectMapper'
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can't find the output directories. Where am I going wrong with setting up the target builds for these git submodules? Thanks!

Linking boost libraries

I have downloaded the boost library (version 1.46.1), but I don't know how to link it through xcode.I found an old question says to put the -lfftw3 flag, so I've put it.
I also added the path: /home/Documents/C++/boost_1_46_1 (it's the directory where I have put the library), but I am getting an error from the linker:
ld: warning: directory not found for option '-L/home/ramy/Documents/C++/boost_1_46_1'
ld: library not found for -lfftw3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Command /Developer/usr/bin/clang++ failed with exit code 1
So the question are two:
1)How to manage xcode to link boost?
2)Where to put the library in file system? In linux there was /usr/lib, here there isn't this path, should I put it in /Developer/usr/lib?
Or for those who are looking for a quick answer (and are on linux), the magic is simply to add the following flags:
-l boost_system