undefined-reference

undefined reference to template function [duplicate]

岁酱吖の 提交于 2019-12-17 06:25:23
问题 This question already has answers here : “Undefined reference to” template class constructor [duplicate] (3 answers) Closed 2 years ago . I have three files . The contents of main.cpp are #include<iostream> #include<QString> #include "util.h" int main() { using Util::convert2QString; using namespace std; int n =22; QString tmp = convert2QString<int>(n); return 0; } util.h namespace Util { template<class T> QString convert2QString(T type , int digits=0); } util.cpp namespace Util { template

Undefined symbols “vtable for …” and “typeinfo for…”?

萝らか妹 提交于 2019-12-17 02:49:21
问题 Nearly the final step but still some strange erros.... bash-3.2$ make g++ -Wall -c -g Myworld.cc g++ -Wall -g solvePlanningProblem.o Position.o AStarNode.o PRM.o PRMNode.o World.o SingleCircleWorld.o Myworld.o RECTANGLE.o CIRCLE.o -o solvePlanningProblem Undefined symbols: "vtable for Obstacle", referenced from: Obstacle::Obstacle()in Myworld.o "typeinfo for Obstacle", referenced from: typeinfo for RECTANGLEin RECTANGLE.o typeinfo for CIRCLEin CIRCLE.o ld: symbol(s) not found collect2: ld

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

℡╲_俬逩灬. 提交于 2019-12-14 03:08:19
问题 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

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

随声附和 提交于 2019-12-13 06:53:39
问题 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

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

六眼飞鱼酱① 提交于 2019-12-13 03:59:41
问题 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

undefined reference when using c++11 qmake flags

試著忘記壹切 提交于 2019-12-13 02:27:16
问题 I have a Qt C++ application that includes a third-party library (along with its .h header file). However, when I set QMAKE_CCFLAGS += -std=c++11 and CONFIG += c++11 , I get undefined reference for function calls to this third-party library. It compiles without c++11 flags. Is there a way to resolve this? This is qmake specific when using c++11 flags in the qmake configuration. The DLL file is linked with qmake LIBS and is compiling without the c++11 qmake configuration flag. Once I set: QMAKE

C++: Linking files with GCC compiler

僤鯓⒐⒋嵵緔 提交于 2019-12-12 16:41:10
问题 I have three files : myh.h; my.cpp; use.cpp. Here are the contents of the files: myh.h extern int foo; void print_foo(); void print(int); my.cpp #include "myh.h" #include <iostream> void print_foo() { std::cout<<foo<<std::endl; } void print(int i) { std::cout<<i<<std::endl; } use.cpp #include "myh.h" int main() { foo=7; print_foo(); print(99); return 0; } GCC spews out the following error: my.o:my.cpp:(.text+0x7): undefined reference to `foo' use.o:use.cpp:(.text+0x10): undefined reference to

c++ undefined reference to `vtable

别来无恙 提交于 2019-12-12 14:20:50
问题 My question has changed from the other one I have posted. I started out with multiple files and decided to put it all in one main.cpp file for now just to get it working. main.cpp: #include <iostream> using namespace std; class arrayListType { public: bool isEmpty() ; bool isFull() ; int listSize() ; int maxListSize() ; void print() ; bool isItemAtEqual(int location, int item) ; virtual void insertAt(int location, int insertItem) = 0; virtual void insertEnd(int insertItem) = 0; void removeAt

android ndk undefined reference to a method

情到浓时终转凉″ 提交于 2019-12-12 12:49:57
问题 Hi Sorry for the long post I am trying to compile some static classes namely jsmn.c,json.c and buf.c which are part of the jsmn json library I downloaded from https://github.com/alisdair/jsmn-example/downloads. I am compiling two STATIC_LIBRARIES lib1 and json_librrary.lib1 has native code which is dependent on json_library.Then I am making two libraries into a shared library containing gnustl_static AND lib1 My folder structure is as follows jni/lib1/ANdroid.mk include $(CLEAR_VARS) LOCAL

libTogl undefined references

一笑奈何 提交于 2019-12-12 11:12:09
问题 I am trying to install netgen (build from source). Therefore Togl is needed and I installed it via sudo apt-get install libtogl1 libtogl-dev When typing 'make' I receive the following error messages: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `Tk_InitStubs' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `tkStubsPtr' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `Tcl_InitStubs