undefined-reference

Calling a C++ function from a C program

Hello, How can I call a C++ function from a C program, is it possible?, and if it is how can I do it?. Thank you. ...

g++ undefined reference to constructor

Hi, I'm compiling and linking a cpp file against a pre-compiled library, and I'm getting an "undefined reference" error. Firstly, this is the command (the library in question is quicknet3, the program I'm compiling is trapper): g++ -w -g -I. -g -O3 -pipe -Wall -I/home/install/x86_64/include/quicknet3 -L/home/install/x86_64/lib -lqui...

C++ templates, undefined reference

I have a function declared like so: template <typename T> T read(); and defined like so: template <typename T> T packetreader::read() { offset += sizeof(T); return *(T*)(buf+offset-sizeof(T)); } However, when I try to use it in my main() function: packetreader reader; reader.read<int>(); I get the following error from ...

C++ - Undefined reference to a class recently created !

Hi, I just created this new class : //------------------------------------------------------------------------------ #ifndef MULTITHREADEDVECTOR_H #define MULTITHREADEDVECTOR_H //------------------------------------------------------------------------------ #include <vector> #include <GL/GLFW.h> //--------------------------------------...

Undefined Reference to class function issue

Hello. I've scoured the internet and my own intellect to answer this basic question, however, much to my own dismay I've been unable to find a solution. I'm normally pretty good about multiple header files however I have hit a wall. The problem is a function that I've declared in a header and defined in its proper namespace in the source...

Undefined reference to 'yylex()'

I'm trying to use flex and bison to create a simple scripting language. Right now, I'm just trying to get a calculator working. I can't get it to compile, though. When I run this makefile: OBJECTS = hug.tab.o hug.yy.o PROGRAM = hug.exe CPP = g++ LEX = flex YACC = bison .PHONY: all clean all: $(OBJECTS) $(CPP) $^ -o $(PROGRAM) clean...

Why is curses on linux giving me following error?

Trying to get getch() working to capture key press. #include <curses.h> ... ... WINDOW *w; char f; w = initscr(); timeout(3000); f = getch(); endwin(); is giving me following error:- undefined reference to `wgetch' undefined reference to `stdscr' ...

simple problem with makefile or header files?

...

Actionscript 3 Dictionary returning undefined/null for key that has just been set in a different class

I'm rendering display objects to the stage depending on the given XML elements, as you can see here: PageRenderer.as private static var curElements:Dictionary = new Dictionary(); //renders the current page private static function renderCode(pageCode:XML):void { if (pageCode) { /...

C++ linker errors, Undefined references to Items that should be referenced from a Share Object

I am building a library, called physgameengine, to aid in building games. This game library links against several libraries, including: Ogre3d, Bullet Physics and SDL, which are in the library files libOgreMain-1.6.5.so, libBulletCollision.a, libBulletDynamics.a, libBulletSoftBody.a, libSDL-1.2.so.0. This Library/Shared object appears to...

C++: Undefined reference to instance in Singleton class

Hi, I'm currently trying to implement a factory as a singleton. I practically used the textbook example of the Singleton pattern. Here's the .h file: namespace oxygen{ class ImpFactory{ public: static boost::shared_ptr<ImpFactory> GetInstance(); private: static boost::shared_ptr<ImpFactory> mInstance; }; and here's the .cp...

Undefined references when trying to link Qt app with my static library.

Hello, I have a static library that I have built with MinGW, I am trying to link to that library from a Qt application. I keep getting linker errors caused by one of the object files in the library. This file actually declares a couple of Boost headers, one for use of shared_ptr and the other so I can make a class noncopyable. I belie...

An error when compiling using curlpp

I tried to compile first simple example, and see compile error: undefined reference to `curlpp::Cleanup::Cleanup()' In linker options i wrote curl-config --libs, in command line $ curl-config --libs -lcurl What am I doing wrong? ...

Undefined reference to...

Hi, I'm doing an opengl/qt3 assignment, but I'm running into an undefined reference error: Renderer.h: ... #include "Mesh.h" ... Mesh mesh; Renderer.cpp: ... mesh.load("ball.obj"); ... Mesh.h: ... bool load(string filename); ... Mesh.cpp: #include "Mesh.h" ... bool Mesh::load(string filename) { ... } ... but the compiler complain...

MinGW/G++/g95 link problem - libf95 undefined reference to `MAIN_'

Hi folks, Summing up, my problem consists on compiling g95 objects inside a C++ application. Actually, I'm constructing an interface for an old fortran program. For this task, I'm using the wxWidgets GUI library, and calling fortran subroutines when necessary. At the beginning, I was developing the entire project compiling my fortran fi...

Undefined reference to ...

I keep getting this error message every time I try to compile, and I cannot find out what the problem is. any help would be greatly appreciated: C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::List()' C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined referenc...

In function `_start': init.c:(.text+0x30): undefined reference to `main'

Hi Guys, I'm working on a C project with around 30 source files (.c). I'm building this project on a 32 bit micro-controller(i.MX515) running on Ubuntu using GNU tools. The compilation phase completes successfully, however when the linking process starts I get this error (For full error at the end of the quesiton): In function `...

Oh no, not another Undefined Reference question!

Unfortunately yes. I have my shared library compiled, the linker doesn't complain about not finding it but still I get undefined reference error. Thinking that I might be doing something wrong I did a little research and found this nice, simple walkthrough: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html which I've followed to the lett...

C code compiled with C++: undefined reference

I have a small program that I can compile with GCC and ICC without any difficulties, but I would also like the code to work with G++ and ICPC. I tried to add this: #ifdef __cplusplus extern "C" { #endif at the beginning and this: #ifdef __cplusplus } #endif at the end of all the header files, but I still get several `undefined ...

Instantiating C++ template functions

Hi, I am facing a few problems with "undefined reference to " errors. I may not be able to post the code, but the declarations and the way I am calling the functions are as follows: Declarations: template <typename T> int pitch_detect(deque<T>& x, int offset, int len); template <typename T> int is_voiced( deque<T>& x, int offset, i...