I have downloaded SDL2 and am trying to build it using the terminal command
./configure --prefix=/home/user/SDL && make && make install
It runs through a laundry list of things, before eventually stopping after spitting out:
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_SDL_iconv in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
"_libiconv_close", referenced from:
_SDL_iconv_close in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
"_libiconv_open", referenced from:
_SDL_iconv_open in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [build/libSDL2.la] Error 1
I have hunted and hunted and have no idea what to do about this. Help?
EDIT:
Breaking it up, ./configure alone works, and then running make afterwords throws up these errors. I don't know if that helps at all.
Related
I am working on a little software that needed a small server that listens to http requests. Unfortunately, the productive server uses https only, so the requests fail. I've search the web and found this example: http://www.boost.org/doc/libs/1_65_0/doc/html/boost_asio/example/cpp03/ssl/server.cpp
I tried my best to apply the required changes. But I can't compile it. I am on a MacOS machine, but the Server is a Ubuntu Server. I installed OpenSSL via brew.
The compilation fails at the linking process:
[ 98%] Linking CXX executable GpdServer
Undefined symbols for architecture x86_64:
"_ERR_remove_thread_state", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in main.cpp.o
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in TcpServer.cpp.o
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in TcpConnection.cpp.o
"_TLSv1_1_client_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in TcpServer.cpp.o
"_TLSv1_1_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in TcpServer.cpp.o
"_TLSv1_1_server_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in TcpServer.cpp.o
"_TLSv1_2_client_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in TcpServer.cpp.o
"_TLSv1_2_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in TcpServer.cpp.o
"_TLSv1_2_server_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in TcpServer.cpp.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[2]: *** [GpdServer] Error 1
make[1]: *** [CMakeFiles/GpdServer.dir/all] Error 2
make: *** [all] Error 2
The TcpConnection files that cause this issue are here:
https://github.com/cwansart/gpd/blob/master/src/TcpServer.h
https://github.com/cwansart/gpd/blob/master/src/TcpServer.cpp
My build system is CMake. Including it works fine.
What am I doing wrong? How do I fix this?
As it turns out the macOS was the issue. I installed OpenSSL via brew. First, my CLion/CMake didn't find it, so I added an if to check if its an Apple PC. In that case I set the path manually to the path brew gave me. Now, for some reason the linking doesn't work.
On Linux with libssl-dev there are no issues.
I'm using Eclipse and have been including the relevant libraries in the project folder as I build. Now that I'm a bit further in the course, I'm trying to
#include "vector.h"
but building gives 16 warnings that look like:
In file included from ../CS106B_Prog_Ass01_05.cpp:6:
Finished building: ../CS106B_Prog_Ass01_05.cpp
../vector.h:560:26: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
and the following error that prevents the project from building:
Undefined symbols for architecture x86_64:
"mainWrapper(int, char**)", referenced from:
_main in CS106B_Prog_Ass01_05.o
"__mainFlags", referenced from:
_main in CS106B_Prog_Ass01_05.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: *** [CS106B_Prog_Ass01_05] Error 1
I would love to simply link to the library folder, but that results in a similar error even if I switch it to a different architecture. Has anyone had this problem?
I've compiled ZeroMQ on Mac OSX 10.9.5 in order to then link to a simple Go program using github.com/pebbe/zmq4, but I'm getting this error I don't understand or know exactly how to remedy.
# github.com/pebbe/zmq4
ld: warning: ignoring file /usr/local/lib/libzmq.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libzmq.dylib
Undefined symbols for architecture i386:
"_zmq_bind", referenced from:
__cgo_59814aec404b_C2func_zmq_bind in zmq4.cgo2.o
__cgo_59814aec404b_Cfunc_zmq_bind in zmq4.cgo2.o
(maybe you meant: __cgo_59814aec404b_Cfunc_zmq_bind, __cgo_59814aec404b_C2func_zmq_bind )
"_zmq_close", referenced from:
__cgo_59814aec404b_C2func_zmq_close in zmq4.cgo2.o
__cgo_59814aec404b_Cfunc_zmq_close in zmq4.cgo2.o
(maybe you meant: __cgo_59814aec404b_C2func_zmq_close,
...
"_zmq_z85_encode", referenced from:
__cgo_59814aec404b_Cfunc_zmq_z85_encode in zmq4.cgo2.o
(maybe you meant: __cgo_59814aec404b_Cfunc_zmq_z85_encode)
ld: symbol(s) not found for architecture i386
collect2: error: ld returned 1 exit status
I think it makes sense that the dylib is made for x86_64 (the Mac) but why Go is trying to link with i386? How do I control that and make it link differently? or even if it's correct?
If you build libzmq yourself, configure with --disable-shared --enable-static keys. If you use homebrew, uninstall zmq and build the library manually. If you need "fat" universal static library use this script:
https://github.com/drewcrawford/libzmq-ios
I am working on facial recognition in video using opencv. I followed the tutorial on opencv's website(http://docs.opencv.org/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.html). I get following error when I try to build my code in xcode.
Undefined symbols for architecture x86_64:
"cv::face::createFisherFaceRecognizer(int, double)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation).
I made a few changes to the code as given in here fatal error: opencv2/contrib/contrib.hpp' file not found (open cv already built)
Please guide me through it as I am new to opencv.
Thanks in advance!
Has anyone had this issue on mac while installing boost or know how to fix? I seem to have everything together but this error. I am using OS X 10.10 & and Xcode 6.1.1.
This is what I used for the install and to make the framework.
http://freddy.cellcore.org/post/79587278354/boost-c-libraries-on-osx-xcode-5
https://gist.github.com/faithfracture/c629ae4c7168216a9856
-------------ERROR BELOW---------------
Undefined symbols for architecture x86_64:
"boost::unit_test::unit_test_main(bool (*)(), int, char**)", referenced from:
_main in test.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)