SFML 2.1 & "lazy symbol binding failed" - lazy-evaluation

I've compiled my SFML program with g++ and that seems to be working fine now (had issues with it previously), however when I try to run the resulting output, I get the following error message:
dyld: lazy symbol binding failed: Symbol not found: __ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE
Referenced from: /Users/fabricecastel/Work/Game_Projects/SFML_tutorials/./a.out
Expected in: /usr/local/lib/libsfml-graphics.2.dylib
dyld: Symbol not found: __ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE
Referenced from: /Users/fabricecastel/Work/Game_Projects/SFML_tutorials/./a.out
Expected in: /usr/local/lib/libsfml-graphics.2.dylib
Trace/BPT trap: 5
I've checked the folder in question and libsfml-graphics.2.dylib isn't missing. Besides that I'm at a total loss as to what the issue is and how I'm supposed to fix it. Seems to me that the RenderWindow symbol isn't included in the dylib but it should be. We're talking SFML 2.1 here, not some obscure amateur project. What's up with that?

The only way I could reproduce these errors is when GCC and Clang version of SFML are mixed. Here are two procedures that create the same errors.
First procedure
install the GCC version
compile your application (successfully)
install the Clang version
run your application
Second procedure
install the Clang version
compile your application (successfully)
install the GCC version
run your application
When you install another runtime, you need to carefully rebuild from scratch your application. That is, remove the final binary as well as any .o files before compiling.

Related

XCode 8.3 OpenGL linker error: Library not loaded

The GLFW library runs fine in an older project (created in XCode 7.x). I used the same method to add library directory and includes files, but this time it prompts a run time error, the error message is:
dyld: Library not loaded: lib/libglfw.3.dylib
Referenced from: /Users/BlacKay/Documents/Projects/OpenGL Tutorials/OpenGL_tutorial_anton/build/Debug/Learn_OpenGL
Reason: image not found
Program ended with exit code: 9
If someone can point what the potential problem is, that'd be great. Thanks~

Trying to compile GnuPG-2.1.1 on OS X Yosemite 10.10.1

While trying to build the latest GnuPG (2.1.1 modern), my build fails when trying to link t-stringhelp. make outputs:
ld: warning: ignoring file libcommon.a, file was built for archive which is not the architecture being linked (x86_64): libcommon.a
Undefined symbols for architecture x86_64:
"_compare_filenames", referenced from:
_main in t-stringhelp.o
"_make_absfilename_try", referenced from:
_main in t-stringhelp.o
"_make_filename_try", referenced from:
_main in t-stringhelp.o
"_percent_escape", referenced from:
_main in t-stringhelp.o
"_strconcat", referenced from:
_main in t-stringhelp.o
"_xstrconcat", referenced from:
_main in t-stringhelp.o
I don't know how to fix this as libcommon is part of the source, so it should build fine. When building with CFLAGS="-m64" (-arch x86_64 does nothing), I get this:
ld: warning: ignoring file ../common/libgpgrl.a, file was built for archive which is not the architecture being linked (x86_64): ../common/libgpgrl.a
Undefined symbols for architecture x86_64:
"_gnupg_rl_initialize", referenced from:
_main in gpg.o
I've also rebuilt all the depandancies (as I built them on Mavericks), except pinentry, as it can't find libiconv which is also installed. My configure outputs that its target is Darwin (x86_64-apple-darwin14.0.0), so this should work. I have also got all the latest prerequisites, tried to install everything in its own directory (--prefix=/usr/local/gnupg-2.1.1), build all the dependancies and GnuPG as 32 bits (again, fails on same error), created a separate build folder and tried to build in there, but only one thing so far has solved the error: looking at how libgpgrl.a is being built - it's only component is common/gpgrlhelp.c - so I cd'ed into g10 and tried to build gpg2, replacing ../common/libgpgrl.a with ../common/gpgrlhelp.o, the lib common.a with all of its object files, for all the libraries that didn't work. Then some programs weren't linking to libksba libgcrypt and libassuan, so I changed the Makefiles, so that they could link. I can now compile all the code well, I installed everything, but I get a new error, when I try to run gpg2:
dyld: lazy symbol binding failed: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
dyld: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
I have everything in my path, which is:
/usr/local/gnupg-2.1.1/bin:/usr/local/gnupg-2.1.1/lib:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
I could compile GnuPG-2.0.22 on Mavericks, but no version of GnuPG builds on Yosemite.
Please help, I'm really confused.
I’ve been running GnuPG 2.1 on Yosemite 10.10.2 (the latest public beta of as of this writing) for about a week and it’s been fine.
You can follow these directions for using brew tap or you can use the raw URL: brew install https://github.com/mtigas/homebrew-gpg21/raw/master/Formula/gnupg2.rb.
Note this formula installs GnuPG 2.1; not GnuPG 2.1.1, the version originally asked about. I can confirm this bug where gpg2 --refresh-keys fails with some keyservers using 2.1 (apparently fixed in 2.1.1) but it’ll get you 90% there.
It shouldn’t be hard to update the formula to install 2.1.1.
Update
Someone submitted a pull request for GNuPG 2.1.1 support—I just tried it and it worked great. Short answer: brew install https://raw.githubusercontent.com/calebthompson/homebrew-gpg21/2.1.1/Formula/gnupg2.rb.
Personally, I would install homebrew, which is a one-liner pasted from their website (http://brew.sh) then do
brew install gnupg
If therw are any problems, run
brew doctor
and heed the good doctor's advice.
Turns out I had a ranlib in /usr/local/bin/ranlib. It was broken, I don't know how it got there (I did try to build gcc at some point, it doesn't support make uninstall, so that's probably why). I just ran:
sudo mv /usr/local/ranlib /usr/local/ranlib_old
Then I just rebuilt all the dependancies, and it worked!

Unity project. Undefined symbols for architecture armv7

I make a build for iPhone for the first time and got a problem.
I already checked a lot of posts and didnt find answer.
When i make a build on device a get:
Undefined symbols for architecture armv7:
"RegisterAllStrippedInternalCalls()", referenced from:
RegisterAllInternalCalls() in libiPhone-lib.a(MonoICallRegistration.o)
"RegisterAllClasses()", referenced from:
InitializeEngineNoGraphics() in libiPhone-lib.a(SaveAndLoadHelper.o)
"RegisterMonoModules()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
On simulator ok.
libiPhone-lib.a added to link libraries.
Can somebody tell what it is? Please
Your unity version is not compatible, just download the latest version of unity which I believe is 4.3.1 and try recompiling. Here is the link if you need it. http://unity3d.com/unity/download/download-mac
The new version is compatible with armv7.
ok if anyone else is experiencing the same problem here's a way out:
those 3 methods mentioned are declared in the RegisterMonoModules.cpp in the Libraries folder, usually. so take that cpp file and add it to your target's Build Phases > Compile Sources
then if you have additional SDK's integrated that are not added to the 'Compile Sources' the new build will throw some other errors. just make sure to add the wrapper .mm files from the sdk's to your Compile Sources. Usually one .mm file per sdk. (e.g. for unity facebook sdk it's FbUnityInterface.mm file)
hope this helps

libiconv.2.dylib not found

I get this error on my Mac OS Lion when I use gcc make:
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
./configure.sh: line 364: 18386 Trace/BPT trap: 5 $QTDIR/bin/qmake "$SRCDIR/$product.pro"
qmake failed
Note: I installed Macports in my machine. This used to work before, is this a known issue with MacPorts?
you can use the built in libiconv by selecting your target, going to the Build Phases tab and adding it to the link libraries and frameworks build phase.
as a general rule if you are missing linker symbols you can look up the symbol in your project and see what header they are from, and you can then usually figure out the appropriate library or framework.
in this case it tells you what library it is expecting...
you will want to use the built in version for a dynamic library, because with default linker flags, if this built product were to get moved to another computer it would try to resolve the symbols at run time in that location, and crash.

Having a issue accessing/loading QJSon dylib at runtime on Mac OS X

I compiled the QJSon code from the command line and it generated a dylib (libqjson.0.7.1.dylib) I then added this file as an external dependency to one of the libraries in my app. (using Xcode 4.3 as the IDE) everything seems to compile correctly. When i go to run the app i get the following error:
dyld: Library not loaded: /Users/shawneckley/Mac_Dev/Development/build/thirdparty/qjson/src/lib/libqjson.0.dylib
Referenced from: /Users/shawneckley/Mac_Dev/Development/Build/bin/Debug/libstonewedgeaccountandclient.dylib
Reason: image not found
(lldb)
any idea why this could be happening?

Resources