linker

Link error in C++ by g++

Please take a look at the program below. Why am I getting an error? #include <stdlib.h> #include <string> #include <string.h> #include <iostream> using namespace std; class serverData { public: static int serverTemp; static int server; }; int main(int argc, char** argv) { string s = "sajad bahmani"; serverData::serve...

Linker error with pointers

I am trying to build a program to Tolkinize a string (i'm trying to do this with out using the string class - so as to learn more about pointers and how chars work) - I have built a program that i think works (any suggestions would be great!) When i tried to compile the program I get these random errors: Error 1 error LNK2019: unreso...

error while loading shared libraries

Hello! I'm trying to install Code::Blocks from source. There is an `anarchy' folder on my university's CS department's mainframe, where anyone can install anything, basically. wxwidgets is a dependency of Code::Blocks, and I'm trying to put wxGTK, as it's called, into my own folder on `anarchy', which works fine. I then compile Code::...

StaticCRT(LIBCMT(D)) and DynamicCRT(MSVCRT(D)) conflict

I am developing a project which uses third party dlls and libraries. I want to build my project using static CRT (LIBCMTD) as I wish to run my application in "IBM purifier". However, the third party libraries are built using dynamic CRT(MSVCRT). This gives linking error as: MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __mktime64 already ...

Struct with a value in a header file causing "duplicate symbol" linker error

This is a cut down example of a much larger project. You can see it here. I have a header file containing the limits of the system time functions. Call it time_config.h. #ifndef TIME_CONFIG_H #define TIME_CONFIG_H #define HAS_TIMEGM #define SYSTEM_LOCALTIME_MAX 2147483647 #define SYSTEM_LOCALTIME_MIN -2147483...

IPhone: Adding Category to CoreLocation threw link error. Why?

Hi I added a category to CLLocation in CoreLocation but kept getting a link error. I search around and through process of TRY IT AND BE DAMNED I fixed the problem by adding -framework CoreLocation to Other Linker Flags But dont know why? I'm guessing its something to do with CoreLocation being and external framework. The Code: CLLoca...

Multiple definition of lots of std:: functions when linking

I am trying to integrate some external code into my application. My code was pure C, but the new code is C++, so I simply renamed my C files to .cc and compiled the whole thing with g++. It compiles fine, but I get a crapton of link errors : CMakeFiles/svrt.dir/svrtH_generator.cc.o: In function `operator new(unsigned long, void*)': svr...

Why does g++ generate multiple (weak) similar symbols ?

I'm looking at the output of nm -C 0804a86a W ForkMessageHandler::ForkMessageHandler() 0804a86a W ForkMessageHandler::ForkMessageHandler() 0804a6fa T ForkMessageHandler::~ForkMessageHandler() 0804a698 T ForkMessageHandler::~ForkMessageHandler() 0804a698 T ForkMessageHandler::~ForkMessageHandler() 0804a800 W MultiMessageHandler::MultiMe...

Does it prohibited calling classic C function from Objective-C++ class method body?

I have experienced some strange behavior of Objective-C++. I have an Objective-C++ class, and it calls a classic C function in a method body. But linker cannot find the C function. I described the problem here: http://stackoverflow.com/questions/2213589/xcode-print-symbol-not-found-for-my-c-function-which-used-in-objective-c-method-b/22...

Compiling nonessential object files with GCC

Consider the following example g++ a.o b.o c.o -o prog If it is the case that c.o does not contribute any executable code to prog, nor are there any dependencies on c.o in any of the other files, will GCC yet include the contents of c.o in prog? Said another way, aside from compilation time, what (if any) negative consequences can th...

Static and shared library symbol conflicts?

I've got a project working on that's using FreeImage and openCV, currently we're using the jpeg support from both of these (I am working towards fixing that, but for now it's got to stay). Anyhow, FreeImage compiles libjpeg 7.0 into its static libraries, and openCV's highgui library links it in as a shared library (on my system, Ubuntu ...

Variable definition in header files

My very basic knowledge of C and compilation process has gone rusty lately. I was trying to figure out answer to the following question but I could not connect compilation, link and pre-processing phase basics. A quick search on the Google did not help much either. So, I decided to come to the ultimate source of knowledge :) I know: V...

How can I resolve linker issues when I compile this C++ program that requires GLUT?

I'm trying to compile this C++ program which utilizes the GLUT32 libraries. Right now I'm getting the following errors: Error 1 error LNK2001: unresolved external symbol _gluPerspective@32 Camera.obj soundCube Error 2 error LNK2001: unresolved external symbol _gluLookAt@72 Camera.obj soundCube Error 3 error LNK2...

How can I link to my own verson of GLib rather than the system installed one?

I have been looking through the source of GLib and GObject and writing programs to use certain features of each. But now I'd like to debug though something in the GLib source code without installing anything on my system. I have a built version of the source code somewhere and I'd like to use those .so files rather than the system inst...

Minimum amount of information necessary to do (dynamic) linking?

This is a question I've come across repeatedly, usually concerning plug ins, but recently I came across it trying to hammer out some build system issues. My concern is primarily for *nix based systems, but I suppose it applies to windows as well. The question is, what is the minimum amount of information necessary to do dynamic linking?...

Any tool/software in windows for viewing ELF file format?

Hello, There are lots of PE file browsers. Here is a list of good ones if you are interested: PE File format viewers: PE Explorer http://www.pe-explorer.com/ PE VIew: http://www.magma.ca/~wjr/ PEBrowse Professional http://www.smidgeonsoft.prohosting.com/pebrowse-pro-file-viewer.html PE Browse Professional Interactive ...

Estimate the size of outputted dll/exe upfront?

Hi, currently I'm fixing some issues regarding to small outputted dll (I'm using Ribosome build system on Windows) so I'm wondering this: suppose project (C++) include source files whose total size is i.e. 100 KB and project also depends on i.e. 3 libraries, each about 100KB, what binary size should I expect after compiling and linking...

Accessing protected method from derived class in a different project (C++) generates linker error

I'm developing in native C++, using visual studio. I have one project which contains infrastructures - base classes which I want to derive classes from in other projects in the same solution. Say I have a base class in the infrastructres project: file base.h: class Base { public: void Foo(); protected: ...

Is it possible to open an html document with word, and have anchor links work within the document?

Hi there, Is it possible to open an html document with word, and have anchor links work within the document? Basically, It'd be nice to do this: <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'&gt; <head></head> <body> <h1>Florida Emergency Supplier Network for 2009-2011</h1> <table id='table_of_contents'>...

Borland linker error

Hello, I am recompling a project using Borland C++ Builder 6 and LMD tool 2010. The recompile process failed due to linker error. The message was: "[Linker Fatal error] Fatal unable to open file LMDOneInstance.OBJ" I searched the whole hard drive, but could not find any reference to LMDOneInstance.OBJ Any help is appreciated. Thanks i...