linker-error

How to call Matlab form C++ code?

I am trying to call Matlab functions form C++ code. With Matlab it comes an example of such code at /extern/examples/eng_mat/engdemo.cpp, however I found no way to build that source code. Here is the makefile I use: CFLAGS = -Wall -O3 INCLUDES = -I/opt/Matlab-2009a/extern/include LIBRARIES = -Wl,-R/opt/Matlab-2009a/bin/glnx86 -L/opt...

Getting undefined references when linking against a static library

I made a static library with GCC. Building of the library was OK. When I use it the linker throws undefined reference errors on some functions. But nm says the functions are defined and exported in the static library (marked with T). I know about the linking order that I need to put the libraries after that module that needs them so thi...

dynamically loaded object loaded into a C program gives undefined symbol errors on x86_64

I have a C program that dynamically loads a .so file at runtime in order to connect to a MySQL database. On an x86 (32bit) kernel this works fine but when I recompile my program on an x86_64 (64 bit) kernel I get runtime errors like this: dlerror: mysql-1.932-x86_64-freebsd7.2.so::plugin_tweak_products: Undefined symbol "plugin_filte...

Trouble with 'extern' Keyword

Hi, I have a set of global variables and a method in a cpp file. int a; int b; int c; void DoStuff() { } in the header file I have declared them explicitly with the extern keyword. My problem is when I include the header file in another C++ file, I can't use the external variables and the method. It's giving a linker error sayin...

Q_OBJECT linker error!!

Hi, I am receiving the following linker error when I build my application. HIMyClass.obj:: error: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CHIMyClass::metaObject(void)const " (?metaObject@CHIMyClass@@UBEPBUQMetaObject@@XZ) File not found : HIMyClass.obj HIMyClass.obj:: error...

"File contains invalid .pdata contributions" when building 64-bit dll

Hi, I currently migrating from 32-bit to 64-bit am encountering a "LNK1223: invalid or corrupt file: file contains invalid .pdata contributions" when attempting to build a 64-bit managed C++ dll that links to an unmanaged C++ .lib file that I also built. So far, I have found that this error should only occur while building for RISC mach...

Linker Error when seperating code into .h and .cpp files

I have an implementation for printing out enum values in c++ If I put all the code in a .h file, everything works nicely. If I separate out the function implementation into .cpp files, I get a linker error. Here is my main file #include <iostream> #include <vector> #include "Day.h" using namespace std; int main(){ initializeDayN...

Unsatisified linker error using JNI

Hello, I wrote a Java class which accesses a method in the C dll through Jni. But i am getting the following error in windows. java.lang.UnsatisfiedLinkError: Server.getNetworkDiagram(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; Guess it is able to load the library. Also i am building the .dll (for window...

Need help interpreting ld linker error

Can anyone tell me what the file "/usr/include/c++/4.4/exception" would have to do with this error. There is no main defined in that file. I am not sure how to read the error message. ./libfoo.a(main.o): In function `main': /usr/include/c++/4.4/exception:62: multiple definition of `main' interface-wx/App.o:/usr/include/c++/4.4/excepti...

Link Error With Visual Studio 2005 Using Windows SDK 7.1

I am in the process of evaluating an upgrade to Windows SDK 7.1 Part of my team's legacy codebase is a large number of ATL web services, which are still maintained using Visual Studio 2005 because (I am told) ATL web services are not supported in versions beyond 2005. When I pointed the IDE to SDK 7.1, I began to receive the following ...

How do I solved Linker errors that go "Unresolved external symbol..."

I am trying to download and build the 'WIC Image Viewer usign Direct2D' from here, but when I build my solution, I am slapped with 56 errors that look like: Error 1 error LNK2019: unresolved external symbol _imp_CoUninitialize@0 referenced in function _wWinMain@16 WICViewerD2D.obj Error 2 error LNK2019: unresolved external ...

$non_lazy_ptr link error with agvtool version variables?

I've been using agvtool for one of my iPhone apps on general principle, and have recently found a reason why I want to be able to check the version variable (so that I can re-copy help content into the Documents directory, if it's out of date). The variable, MyAppVersionNumber, defined in MyApp_vers.c, is auto-generated during the build...

gcc, static library, external assembly function becomes undefined symbol

Hello everybody, I have a problem with g++ building an application which links to a static library, where the latter shall contain some global functions written in external asm-files, compiled with yasm. So in the library, I have #ifdef __cplusplus extern "C" { #endif extern void __attribute__((cdecl)) interp1( char *pSrc ); extern voi...

error LNK2019 unexplainable when trying to port openldap to windows

Hi , I m working on windows XP with visual studio 2005. My project is a Cmake project created after creating an LDAP abstraction API on linux.I m trying somehow to make it work on windows. I've got an unusual linking error of type LNK2019 code : main.obj : error LNK2019: symbole externe non résolu _strcpy référencé dans la fonction _m...

Linking Errors trying CS106B

I attempted to start a blank VS2008 project and follow along with the things being typed during the lectures, but I ran into a horrendous bunch of link errors. In the zip file for assignment 1 for the PC, there is a folder called CS106B. First I told the compiler where the header files are (they're in the CS106B folder). Next I had to t...

Help with this Makefile

Hi, Here is my makefile http://pastie.org/1104332. I am trying to compile different .c files and .s files (assembly files) from different sub directories into E:/em35x/build/mfg-sample-app-cortexm3-iar-em357-em3xx-dev0680/ then the linker should link all the .o files from the build directory (E:/em35x/build/mfg-sample-app-cortexm3-iar-e...

C++ - LNK2019 error unresolved external symbol [template class's constructor and destructor] referenced in function _main

[[UPDATE]] -> If I #include "Queue.cpp" in my program.cpp, it works just fine. This shouldn't be necessary, right? Hey all -- I'm using Visual Studio 2010 and having trouble linking a quick-and-dirty Queue implementation. I started with an empty Win32 Console Application, and all files are present in the project. For verbosity, here's t...

linker error using wxwidgets with cmake

HI, I'm getting following linker error when I compile my program with VS2008 solution which is created with CMake for my wxwidgets based application. *error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup* but, same program I'm able to compile with normal VS2008 solution which is not created with CMake...

C++: pure virtual assignment operator

why if we have pure virtual assignment operator in a base class, then we implement that operator on the derived class, it give linker error on the base class? currently I only have the following explanation on http://support.microsoft.com/kb/130486 , it said that the behavior is by design since normal inheritance rules does not apply. ...

Linker Error in Objective-C static library with unit testing

In my Cocoa Touch static library project, I have a target set apart for unit testing with OCUnit. When I build the project, I have several unit tests that are supposed to automatically run, but when I actually build the project, I get this linker errors: "_OBJC_CLASS_$_ObjectIntTreeMap_ObjectEntry", referenced from: objc-class-ref-to-Ob...