undefined-reference

undefined reference to gzdopen, gzclose, gzread

一曲冷凌霜 提交于 2019-12-12 04:45:12
问题 I have compiled and installed the 2.2.7.2 version of libxml. While compiling, I have this error: Makefile:755: recipe for target 'install-data-local' failed. But the lib files are correctly generated (libxml2.a and libxml2.so). I'd like to use libxml2 in a C project so I edited my makefiles in order to integrate lib files (libxml2.a and libxml2.so). The problem is that when I compile my project I get the followings errors: /libxml2.a(xmlIO.o): In function xmlGzfileRead': undefined reference

Undefined reference with -static?

别等时光非礼了梦想. 提交于 2019-12-12 04:17:05
问题 When I try to compile my program with CFLAGS = -static i receive an error undefined reference. When compiling without static works perfectly. My question is why the static error gives me undefined reference? I installed with pkg install mysql57-server And linked mysql_config --libs Help ? 回答1: When linking static libs, the order in which they come in command line matters (well, at least on FreeBSD). Try putting -lmysqlclient before/after all libraries. And make sure there is /usr/local/lib

Undefined reference in make

爱⌒轻易说出口 提交于 2019-12-12 03:55:26
问题 I'm compiling a code with many files and some are located in the local MATLAB installation folder. For this I've added an include to g++ which apparently doesn't resolve well because I get an undefined reference to for all MATLAB-C++ functions (I'm trying to use the MATLAB C++ Engine) as shown in the following screenshot: The Makefile is very short and as such: I've checked the referenced directory and it does include the "Engine.h" referenced by constraints.cpp which is generally enough to

What is an undefined reference/unresolved external symbol error and how do I fix it?

萝らか妹 提交于 2019-12-12 02:44:16
问题 What are undefined reference/unresolved external symbol errors? What are common causes and how to fix/prevent them? Feel free to edit/add your own. 回答1: Compiling a C++ program takes place in several steps, as specified by 2.2 (credits to Keith Thompson for the reference): The precedence among the syntax rules of translation is specified by the following phases [see footnote] . Physical source file characters are mapped, in an implementation-defined manner, to the basic source character set

Link error: undef reference - friend function

痞子三分冷 提交于 2019-12-12 01:46:54
问题 Just the salient details: Compilation : g++ -c memref_test.cpp g++ -c -I/home/chap/private/WDI/git -I/home/chap/private/WDI/git/include -I/usr/local/mysql/include -I/usr/local/include -I/home/chap/private/WDI/git -I/home/chap/private/WDI/git/include -I/usr/include/mysql -fno-strict-aliasing -g -O0 --std=c++11 MemRef.cpp g++ -o memref_test memref_test.o MemRef.o Error : MemRef.h:36:24: warning: inline function ‘bool operator<(const MemRef&, const MemRef&)’ used but never defined [enabled by

Undefined references to base template class' methods

萝らか妹 提交于 2019-12-11 20:34:51
问题 I have a bunch of things mixed, and they all lead to undefined references. Please, excuse me for simply dropping the code, but, since I don't know which are the individual problems, I can't search for them. c.hpp // A public class class C { private: // This class is private because it is used just for convenience; // it is not part of C's interface. Its methods are not defined because // the types for which it will be instantiated are known. template<typename T> class Base { private: T*

Undefined reference to cv::imread

时光毁灭记忆、已成空白 提交于 2019-12-11 20:33:36
问题 I know this has been asked several times but still I am struggling with linker error undefined reference for simple opencv code. This is my code: #include <opencv2/highgui.hpp> using namespace cv; int main(int argc, char** argv) { Mat inputImage = imread(argv[1]); imshow("Input Image", inputImage); waitKey(0); } I am using eclipse IDE, cygwin g++ compiler and opencv 3.0. I have correctly given include path, library search path as "C:\opencv\build\x64\vc11\lib" & "C:\opencv\build\x64\vc11

compiling error with make command std::__cxx11

拟墨画扇 提交于 2019-12-11 19:09:59
问题 At first, my Makefile is written as: .SUFFIXES: .c .cpp CC = g++ -fopenmp # CFLAGS = -c -Wall -D_I386 -D_UNIX -O2 -fPIC -Wno-deprecated -Wno-unused-result -std=c++0x -Wno-sign-compare CFLAGS = -c -O2 -Wall -D_I386 -D_UNIX -fPIC -Wno-unused-result -std=c++11 -Wno-sign-compare -D_GLIBCXX_USE_CXX11_ABI=0 LFLAGS = -shared -O2 -o LIBS = -llmi -lblas -lboost_regex -lpthread -lleveldb MAINDIR = ../../../ LIBDIR = ${MAINDIR}lib/ LD_PATH = -L${LIBDIR} INCLUDEDIR = ${MAINDIR}include/Lheader IN_PATH =

Undefined reference to cmph functions even after installing cpmh library

爷,独闯天下 提交于 2019-12-11 17:14:32
问题 I am using gcc 4.4.3 on ubuntu. I installed cmph library tools 0.9-1 using command sudo apt-get install libcmph-tools Now, when I tried to compile example program vector_adapter_ex1.c , gcc is able to detect cmph.h library in its include file but is showing multiple errors like vector_adapter_ex1.c:(.text+0x93): undefined reference to cmph_io_vector_adapter' vector_adapter_ex1.c:(.text+0xa3): undefined reference to cmph_config_new' vector_adapter_ex1.c:(.text+0xbb): undefined reference to

undefined reference to ruserok error

懵懂的女人 提交于 2019-12-11 12:03:09
问题 I've run into a strange "undefined reference to" compile error that I cannot seem to find a resolution for. I'm trying to configure/compile PAM 1.1.6 for my Gumstix Overo using the Yocto Project generated ARM compiler (arm-poky-linux-gnueabi-gcc), but I keep getting the following error during compilation: .libs/pam_rhosts.o: In function `pam_sm_authenticate': modules/pam_rhosts/pam_rhosts.c:117: undefined reference to `ruserok' collect2: error: ld returned 1 exit status So, I did a some