-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined symbols for architecture x86_64 #21
Comments
Looks like you forgot to link your code with the X11 library:
or, if you don't have X11 installed and if you don't want display capabilities of CImg:
|
Thank you, all ok after installing x11 |
I tried doing this to no avail. I also used -L/opt/X11 and I still get the same errors |
@trmontgomery did you install xquartz ? (google it) |
@devernay Yes I did. |
did you use this compile line:
|
@devernay Wow that worked! Any idea on why I can't compile with g++? (Edit: Apparently the gcc that comes with Mac is just clang...) |
Hi, I tried to compile one of the examples on mac os x 10.11, but i got below error.
$ g++ -o main captcha.cpp
Undefined symbols for architecture x86_64:
"_XAllocClassHint", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XCheckMaskEvent", referenced from:
cimg_library::CImgDisplay::events_thread(void) in captcha-e2d6a3.o
"_XCheckTypedEvent", referenced from:
cimg_library::CImgDisplay::events_thread(void) in captcha-e2d6a3.o
"_XCheckWindowEvent", referenced from:
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XCloseDisplay", referenced from:
cimg_library::CImgDisplay::screen_width() in captcha-e2d6a3.o
cimg_library::CImgDisplay::screen_height() in captcha-e2d6a3.o
"_XCreateColormap", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XCreateImage", referenced from:
void cimg_library::CImgDisplay::_resize(unsigned char, unsigned int, unsigned int, bool) in captcha-e2d6a3.o
void cimg_library::CImgDisplay::_resize(unsigned short, unsigned int, unsigned int, bool) in captcha-e2d6a3.o
void cimg_library::CImgDisplay::_resize(unsigned int, unsigned int, unsigned int, bool) in captcha-e2d6a3.o
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
"_XCreateSimpleWindow", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XCreateWindow", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
"_XDestroyWindow", referenced from:
cimg_library::CImgDisplay::assign() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_desinit_fullscreen() in captcha-e2d6a3.o
"_XFree", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XFreeColormap", referenced from:
cimg_library::CImgDisplay::assign() in captcha-e2d6a3.o
"_XGetVisualInfo", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XGetWindowAttributes", referenced from:
cimg_library::CImgDisplay::resize(int, int, bool) in captcha-e2d6a3.o
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_map_window() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XGrabKeyboard", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XInternAtom", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XLookupString", referenced from:
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XMapRaised", referenced from:
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_map_window() in captcha-e2d6a3.o
"_XMoveWindow", referenced from:
cimg_library::CImgDisplay::move(int, int) in captcha-e2d6a3.o
"_XOpenDisplay", referenced from:
cimg_library::CImgDisplay::screen_width() in captcha-e2d6a3.o
cimg_library::CImgDisplay::screen_height() in captcha-e2d6a3.o
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XPutImage", referenced from:
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_paint(bool) in captcha-e2d6a3.o
"_XQueryKeymap", referenced from:
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XResizeWindow", referenced from:
cimg_library::CImgDisplay::resize(int, int, bool) in captcha-e2d6a3.o
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XSelectInput", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
"_XSendEvent", referenced from:
cimg_library::CImgDisplay::_paint(bool) in captcha-e2d6a3.o
"_XSetClassHint", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XSetInputFocus", referenced from:
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XSetWMProtocols", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XSetWindowColormap", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XStoreColors", referenced from:
cimg_library::CImgDisplay::_set_colormap(unsigned long&, unsigned int) in captcha-e2d6a3.o
"_XStoreName", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XSync", referenced from:
cimg_library::CImgDisplay::assign() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_map_window() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XUngrabKeyboard", referenced from:
cimg_library::CImgDisplay::_desinit_fullscreen() in captcha-e2d6a3.o
"_XUnmapWindow", referenced from:
cimg_library::CImgDisplay::_handle_events(XEvent const) in captcha-e2d6a3.o
"_XVisualIDFromVisual", referenced from:
cimg_library::CImgDisplay::assign(unsigned int, unsigned int, char const, unsigned int, bool, bool) in captcha-e2d6a3.o
"_XWindowEvent", referenced from:
cimg_library::CImgDisplay::_init_fullscreen() in captcha-e2d6a3.o
cimg_library::CImgDisplay::_map_window() in captcha-e2d6a3.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The text was updated successfully, but these errors were encountered: