GraphicsMagick, Undefined symbols for architecture x86_64 - undefined-symbol

I am trying to install GraphicsMagick in Xcode4, I am getting this error when i execute command 'make'.
/usr/bin/ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-module.o) has no symbols
/usr/bin/ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-PreRvIcccm.o) has no symbols
libtool: link: ranlib magick/.libs/libGraphicsMagick.a
ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-module.o) has no symbols
ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-PreRvIcccm.o) has no symbols
Undefined symbols for architecture x86_64:
"___builtin_object_size", referenced from:
_BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o)
_XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
_YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [utilities/gm] Error 1
make: *** [install] Error 2

GraphicsMagick won't compile on OS X 10.7 (Lion) or 10.8 (Mountain Lion) with the default LLVM GCC/G++ compilers. The workaround is to use the Clang compiler instead:
./configure CC=clang [...other config options...]
It is also a good idea to run the unit tests with make check after compilation just to be on the safe side.
This trick worked for me, hope it helps.

You can find a solution here.
http://sourceforge.net/projects/graphicsmagick/forums/forum/250738/topic/5221775

Related

Theos not compiling with Arm64

I am trying to package a Jailbreak Tweak using Theos on Windows 8.1 (64bit). If I do not specify Arm64 it compiles fine and works on my iPhone 5. However not my 6s. The console says a big error which I don't understand. Any help trying to get this tweak to compile with 64bit architecture would be great.
Makefile:
ARCHS = armv7 armv7s arm64
test_FRAMEWORKS = UIKit
include theos/makefiles/common.mk
TWEAK_NAME = Forton
Forton_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += fortonprefs
include $(THEOS_MAKE_PATH)/aggregate.mk
Error Log:
$ make package
/home/AbbottL/forton/theos/makefiles/targets/Cygwin/iphone.mk:38: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak Forton...
Linking tweak Forton...
ld: warning: ignoring file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o, missing required architecture arm64 in file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o (2 slices)
ld: warning: ignoring file /home/AbbottL/forton/theos/lib/libsubstrate.dylib, file was built for armv7 which is not the architecture being linked (arm64): /home/AbbottL/forton/theos/lib/libsubstrate.dylib
Undefined symbols for architecture arm64:
"_MSHookMessageEx", referenced from:
_logosLocalInit() in Tweak.xm.91812798.o
ld: symbol(s) not found for architecture arm64
armv7-apple-darwin11-clang: error: linker command failed with exit code 1 (use -v to see invocation)
/home/AbbottL/forton/theos/makefiles/instance/library.mk:27: recipe for target 'obj/Forton.dylib.1b5b9d6a.unsigned' failed
make[2]: *** [obj/Forton.dylib.1b5b9d6a.unsigned] Error 1
/home/AbbottL/forton/theos/makefiles/instance/library.mk:19: recipe for target 'internal-library-all_' failed
make[1]: *** [internal-library-all_] Error 2
/home/AbbottL/forton/theos/makefiles/master/rules.mk:54: recipe for target 'Forton.all.tweak.variables' failed
make: *** [Forton.all.tweak.variables] Error 2
Using ios 8.1 SDK
Fixed by swapping libsustrate file to a later version.

Getting error while Installing GMP 6.1.0 in iOS9.2 Xcode7.2

I have tried to install GMP Library Version 6.1.0 for iOS9.
I need to compile GMP in iOS for a math project. My configuration command was like this.
./configure CC=clang CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E" CPPFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -fembed-bitcode -miphoneos-version-min=7.0 -arch armv7 -target arm-apple-darwin" --host=aarch64-apple-darwin --disable-assembly --enable-static --disable-shared --disable-thread-safe --enable-cxx
Found this configure option in :This link.
Here is my environment details:
Mac OSX 10.11.2; Xcode7.2; iOS SDK 9.2
During "configure" state it shows one warning
configure: WARNING: unrecognized options: --disable-thread-safe
But it configures without any error.
Configure summary:
configure: summary of build options:
Version: GNU MP 6.1.0
Host type: aarch64-apple-darwin
ABI: standard
Install prefix: /usr/local
Compiler: clang
Static libraries: yes
Shared libraries: no
After that I run make command.
Then make check.
While running make check command it gives the following error.
or, in text form:
/bin/sh ../libtool --tag=CC --mode=link clang -mfpu=neon -O2 -pedantic -DNO_ASM -o t-bswap t-bswap.o libtests.la ../libgmp.la
libtool: link: clang -mfpu=neon -O2 -pedantic -DNO_ASM -o t-bswap t-bswap.o ./.libs/libtests.a [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a ../.libs/libgmp.a
ld: warning: ld: warning: ignoring file ./.libs/libtests.a, file was built for archive which is not the architecture being linked (x86_64): ./.libs/libtests.aignoring file t-bswap.o, file was built for armv7 which is not the architecture being linked (x86_64): t-bswap.o
ld: warning: ignoring file [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): /Users/[redacted]/Documents/gmp-6.1.0/.libs/libgmp.a
ld: warning: ignoring file ../.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): ../.libs/libgmp.a
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [t-bswap] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check-recursive] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2
I am stuck here. Your help is highly appreciated.
[EDITED]

Undefined symbols for architecture armv7 "_saveToGallery"

I am using Unity3D5.2 to export a iOS project, but when compile in Xcode encounter this problem,please help!
ld: warning: directory not found for option '-
L/Users/lzy/Downloads/IOS88888/LibrariesPlugins/iOS'
Undefined symbols for architecture arm64:
"_saveToGallery", referenced from:
_ScreenshotManager_saveToGallery_m182 in Bulk_Assembly-CSharp_0.o
(maybe youmeant: _ScreenshotManager_saveToGallery_m182)
ld: symbol(s) not found for
architecture arm64 clang: error: linker command failed with exit code 1 (use
-v to see invocation)
One of your library miss the target architecture. Try Simulator or another device with difference cpu.
List all available architecture in your library with cmmand 'lipo -info'
eg:
localhost:~ user$ lipo -info /Applications/iTerm.app/Contents/Frameworks/Sparkle.framework/Sparkle
Architectures in the fat file: /Applications/iTerm.app/Contents/Frameworks/Sparkle.framework/Sparkle are: ppc i386 x86_64
You miss an additional '/' in your library search path. it's a bug in Vuforia that there are '\' instead of '/' in the pathnames. Apple (and linux) treats '\' as escape characters in pathnames.
you have : '/LibrariesPlugins/iOS'
right path: '/Libraries/Plugins/iOS'

in /usr/lib/system/libcache.dylib, missing required architecture armv6

In attempting to compile a dummy program for iphoneos, Xcode4, gcc does not appear to reach beyond the initial sysroot directory
$ echo $ISYSROOT
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
$ gcc -arch armv6 --sysroot=$ISYSROOT test.cpp
ld: in /usr/lib/system/libcache.dylib, missing required architecture armv6 in file for architecture armv6
collect2: ld returned 1 exit status
If I leave out sysroot,
$ gcc -arch armv6 test.cpp
ld: warning: ignoring file /usr/lib/crt1.o, missing required architecture armv6 in file
ld: warning: ignoring file /usr/lib/libgcc_s.1.dylib, missing required architecture armv6 in file
ld: warning: ignoring file /usr/lib/libSystem.dylib, missing required architecture armv6 in file
Undefined symbols for architecture armv6:
"start", referenced from:
-u command line option
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status
The following works, but it feels very cheesy, and not scalable. What's going on here?
$ gcc -arch armv6 -L$ISYSROOT/usr/lib/system --sysroot=$ISYSROOT test.cpp
Update. Apparently this is a known issue, though it still is not clear how to pass sysroot to gcc but isysroot to ld
http://www.doitscared.com/?m=201104
When compiling the library, if you see this error “ld: file not found:
/usr/lib/system/libcache.dylib for architecture armv7″, then your
linker command is using “–sysroot” which doesn’t work in Xcode 4.
Instead, change the linker command to use “-isysroot”. (Note: This
only applies to the linker command. The compile commands must continue
to use “–sysroot”. See here for more details.)
Change the Deployment Target of your project to be at least 4.3 and it will work. This is a problem with XCode 4 but there really isn't a need to deploy apps to iOS versions prior to 4.3. iOS users tend to stay pretty up-to-date with their iOS versions.

Linking OpenCV 2.3 program in Mac OS X Lion: symbol(s) not found for architecture x86_64

I'm having a problem when trying to compile the program in this tutorial from the OpenCV 2.3 official documentation. I have created the CMakeList.txt like it's said in the link. Well, it didn't work.
After a good time searching Google and trying to fix it, I have added the correct lib and include folders to the OpenCVConfig.make (at /opt/local/share/opencv here). Well, this is the output when I try to make it:
$ cmake .
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/carlosagarie/dropbox/code/c++/opencv
$ make
Linking CXX executable teste
Undefined symbols for architecture x86_64:
"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
_main in teste.cc.o
"cv::imshow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)", referenced from:
_main in teste.cc.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [teste] Error 1
make[1]: *** [CMakeFiles/teste.dir/all] Error 2
make: *** [all] Error 2
Trying to find out why it said ld: symbol(s) not found for architecture x86_64, I looked at my libraries folder (/opt/local/lib) and used the file command:
libopencv_calib3d.2.2.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64
The same for all the other libs. So, I assume that it's not a problem with them. But, why isn't ld working them? I really don't know what to do.
The code is the same as in the tutorial presented earlier. My CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8)
project( teste )
find_package( OpenCV REQUIRED )
add_executable( teste teste )
target_link_libraries( teste ${OpenCV_LIBS} )
Thanks in advance!
I noticed you are following the 2.3.x guide, but the link error is referring to 2.2.0. Which version are you using?
Have you tried compiling it manually?
With something like this:
Assuming OPENCV_ROOT is set to your install location (e.g., /opt/local)
g++ -I$OPENCV_ROOT/include -L$OPENCV_ROOT/lib -lopencv_core2.2.0 -lopencv_calib3d2.2.0 -c test.cpp
If that doesn't work, have you tried running ldconfig as root? Is the install location for the opencv libraries setup in /etc/ld.so.conf (If not, you need to do this first before ldconfig will do anything useful)?
Edit you answer with updates to these questions. And, I'll try to help you with the rest.
EDIT :
You might also try adding this to your ~/.profile and see it fixes it:
export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib
Have you tried following this guide starting from Section 2 with XCode?

Resources