Undefined symbols for architecture x86_64:
-
how to solve this problem?
Undefined symbols for architecture x86_64:
"_XCheckMaskEvent", referenced from:
cimg_library::CImgDisplay::thread_lowlevel(void*) in args.o
"_XCheckTypedEvent", referenced from:
cimg_library::CImgDisplay::thread_lowlevel(void*) in args.o
"_XCheckWindowEvent", referenced from:
cimg_library::CImgDisplay::proc_lowlevel(_XEvent*) in args.o
"_XCloseDisplay", referenced from:
cimg_library::CImgDisplay::~CImgDisplay() in args.o
"_XCreateColormap", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XCreateImage", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
cimg_library::CImgDisplay::resize(int, int, bool, bool) in args.o
"_XCreateSimpleWindow", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XDestroyWindow", referenced from:
cimg_library::CImgDisplay::~CImgDisplay() in args.o
"_XFlush", referenced from:
cimg_library::CImgDisplay& cimg_library::CImgDisplay::display<unsigned char>(cimg_library::CImg<unsigned char> const&, unsigned int, unsigned int) in args.o
cimg_library::CImgDisplay::resize(int, int, bool, bool) in args.o
"_XFreeColormap", referenced from:
cimg_library::CImgDisplay::~CImgDisplay() in args.o
"_XGetVisualInfo", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XGetWindowAttributes", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XInternAtom", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XLookupString", referenced from:
cimg_library::CImgDisplay::proc_lowlevel(_XEvent*) in args.o
"_XMapWindow", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XOpenDisplay", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XPutImage", referenced from:
cimg_library::CImgDisplay& cimg_library::CImgDisplay::display<unsigned char>(cimg_library::CImg<unsigned char> const&, unsigned int, unsigned int) in args.o
cimg_library::CImgDisplay::proc_lowlevel(_XEvent*) in args.o
cimg_library::CImgDisplay::resize(int, int, bool, bool) in args.o
"_XResizeWindow", referenced from:
cimg_library::CImgDisplay::proc_lowlevel(_XEvent*) in args.o
cimg_library::CImgDisplay::resize(int, int, bool, bool) in args.o
"_XSelectInput", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
cimg_library::CImgDisplay::thread_lowlevel(void*) in args.o
"_XSetWMProtocols", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XSetWindowColormap", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XStoreColors", referenced from:
cimg_library::CImgDisplay::set_colormap(unsigned long&, unsigned int) in args.o
"_XStoreName", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XUnmapWindow", referenced from:
cimg_library::CImgDisplay::proc_lowlevel(_XEvent*) in args.o
"_XVisualIDFromVisual", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.o
"_XWindowEvent", referenced from:
cimg_library::CImgDisplay::new_lowlevel(char const*) in args.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: *** [SimpleNGL.app/Contents/MacOS/SimpleNGL] Error 1
01:43:52: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project SimpleNGL (kit: Desktop Qt 5.2.0 clang 64bit)
When executing step 'Make' -
You are probably mixing architectures (your library is compiled for 32 bit, but you are compiling in a 64 bit environment). You need to link to a correct architecture.
-
thanks for your reply! what i need to do? can u explain the detail? many thanks!
[quote author="sierdzio" date="1407733457"]You are probably mixing architectures (your library is compiled for 32 bit, but you are compiling in a 64 bit environment). You need to link to a correct architecture.[/quote] -
Use 64 bit cimg library instead of a 32 bit one. I know to little about your setup (OS, .pro filecode showing library inclusion, Qt version) to say much more.
-
Many thanks sir! the pro file is:
TEMPLATE = app
INCLUDEPATH += /opt/X11/includeInput
HEADERS += args.h block.h CImg.h graph.h main.h
SOURCES += args.cpp argsgraph.cpp graph.cpp main.cpp maxflow.cppmy os is:
10. 9.4
my qt version is:
qt creator 3.0.0 Based on QT 5.2.0(Clang 4.2(Apple), 64 bit)
[quote author="sierdzio" date="1407753306"]Use 64 bit cimg library instead of a 32 bit one. I know to little about your setup (OS, .pro filecode showing library inclusion, Qt version) to say much more.[/quote] -
You are missing LIBS in there. It is not enough to include the header of a library, you need to tell the linker (ld) where it can find the library, so that it can be linked.
See "the documentation":http://qt-project.org/doc/qt-5/qmake-variable-reference.html#libs.
-
Really thank u, Sir! But the CImg's homage said that it doesn't need to compile it or do sth else, just include the Cimg.h, here is the link http://sourceforge.net/projects/cimg/files/
Sorry for my poor english, i am not a native spearer, also it works on other people's red hat , but I don't know how to deal with here on my mac, can I send the code to your and let u have a look? if it's possible. Sorry to bother u!
[quote author="sierdzio" date="1407753780"]You are missing LIBS in there. It is not enough to include the header of a library, you need to tell the linker (ld) where it can find the library, so that it can be linked.See "the documentation":http://qt-project.org/doc/qt-5/qmake-variable-reference.html#libs.[/quote]
-
I see. It is uncomon to see a single header being named a library. I am not familiar with it. I suspect you need to first compile that into a library, and then include that library in your source code. But maybe it is intended to work in a different way.