undefined-reference

Undefined reference to 'inflateInit2_'

泄露秘密 提交于 2019-11-28 03:35:05
问题 I'm using Code Blocks IDE and I want to install Tiled Map Editor for SFML. So, I downloaded the source and imported it to my project. Unfortunately, the build finished with an error due to missing zlib library. I downloaded it and built again. This time I received an error that reads: undefined reference to `inflateInit2_'| undefined reference to `inflateEnd'| undefined reference to `inflateEnd'| On the Internet I found the advice to join the linker command -lz , but the compiler refuses

C error: undefined reference to function, but it IS defined

我的未来我决定 提交于 2019-11-28 03:33:01
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, point.h : //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); And here's point.c : //This is the implementation of the point type #include "point.h" int main() { return 0; } Point create(double x, double y) { Point p; p.x = x; p.y = y; return p; } Point midpoint(Point p, Point q) { Point mid; mid.x = (p.x + q.x) / 2; mid.y = (p.y + q.y) / 2; return mid; } And here's where the compiler

gcc undefined reference to

瘦欲@ 提交于 2019-11-28 03:30:14
问题 I'm running.. gcc -c -I/usr/vt/sample ttssample.c gcc -L. -lttsapi ttssample.o -o ttsample and I'm getting the following error... ttssample.o: In function `_TTSFile': ttssample.c:(.text+0x352): undefined reference to `TTSRequestFile' ttssample.o: In function `_TTSFileEx': ttssample.c:(.text+0x5e0): undefined reference to `TTSRequestFileEx' ttssample.o: In function `_TTSBuffer': ttssample.c:(.text+0x833): undefined reference to `_TTSRequestBuffer' ttssample.o: In function `_TTSBufferEx':

Undefined symbol error importing Cython module

这一生的挚爱 提交于 2019-11-28 03:13:32
问题 I want to make available one of my c++ classes as Python module. The class is declared in a header Foo.h and implemented in a .cpp Foo.cpp . (g++-4.5, Ubuntu x86_64). It's a very very simple class: Foo.cpp : Foo::Foo() : alfa(1.0), beta(1) { } Foo::~Foo() { } Foo.h : class Foo { public: Foo() Foo(const Foo& orig); ~Foo(); double alfa; int beta; }; I created a setup.py as shown in Cython tutorial: setup.py from distutils.core import setup from distutils.extension import Extension from Cython

Using GCC Undefined Behavior Sanitizer

ぐ巨炮叔叔 提交于 2019-11-28 02:41:56
问题 Today I have read an article about GCC Undefined Behavior Sanitizer (ubsan) . However, when I follow steps there (add -fsanitize=undefined to my code), the compiler (GCC 4.9.2 on Ubuntu 15.04) says that some references are not defined: ||=== Build: Debug in Entangle (compiler: GNU GCC Compiler) ===| obj/Debug/EntangleApp.o||In function `EntangleApp::OnInit()':| /home/ilya/Projects/Entangle/EntangleApp.cpp|31|undefined reference to `__ubsan_handle_type_mismatch'| /home/ilya/Projects/Entangle

Undefined Reference to a function

[亡魂溺海] 提交于 2019-11-28 01:30:44
问题 I'm using Linux and I have the following files: main.c, main.h fileA.c, fileA.h fileB.cpp, fileB.h The function F1() is declared in fileB.h and defined in fileB.cpp . I need to use the function in fileA.c , and so I declared the function as extern void F1(); in fileA.c . However, during compilation, I got the error fileA.c: (.text+0x2b7): undefined reference to `F1' What is wrong? Thank you. ETA: Thanks to the answers I've received, I now have the following: In fileA.h, I have #include fileB

In C programming, what is `undefined reference`error, when compiling? [duplicate]

不羁岁月 提交于 2019-11-28 01:07:41
问题 This question already has answers here : What does the “undefined reference to varName” in C mean? (6 answers) Closed 4 years ago . I have this following simple program I am trying to compile in linux ubuntu. Main.c : #include <stdio.h> #include "Person.h" int main() { struct Person1 p1 = Person1_Constructor(10, 1000); } Person.c : #include <stdio.h> #include "Person.h" struct Person1 Person1_Constructor(const int age, const int salary) { struct Person1 p; p.age = age; p.salary = salary;

C++ undefined reference to template class method [duplicate]

倖福魔咒の 提交于 2019-11-28 00:35:11
This question already has an answer here: Why do I get “unresolved external symbol” errors when using templates? [duplicate] 3 answers Undefined reference to template members 1 answer I always get undefined reference to `Graph::InsertVertex(std::string)' if I compile my project! Any hints why he cant resolve this reference? (all Files are in the netbeans project folder) // main.cpp #include <cstdlib> #include <string> #include "Graph.h" using namespace std; int main(int argc, char** argv) { Graph<string> *graph = new Graph<string>(); // <--- ERROR graph->InsertVertex("A"); return 0; } // Node

How to properly link libraries with cmake?

心已入冬 提交于 2019-11-27 18:47:34
I can't get the additional libraries I am working with to link into my project properly. I am using CLion, which uses cmake to build it's projects. I am trying to use several libraries in conjunction with OpenGL to texture some objects. I initially built it in Visual Studio, because I couldn't ever figure out how to get cmake to work with Clion. However, now that the code is all working (in Visual Studio, anyways), I want to be able to use CLion for it, because that is my preferred IDE. I am still new to cmake, and I don't understand what I am doing wrong with my CMakeLists.txt . Here is what

glfw3 compiling undefined references

╄→гoц情女王★ 提交于 2019-11-27 16:26:26
问题 I have a problem with compiling my program which uses glfw3 library. I'm getting list of errors of undefined references when trying to compile with make but my classes are compiled into .o files, only final executable file is not created. stdout: g++ -Wall -g -c main.cpp -lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi g++ -Wall -g -c error.cpp -lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi g++ -Wall -g -c sWindow.cpp -lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread