linker

Relation between object file and shared object file

what is the relation b/w shared object(.so) file and object(.o) file can you please explain via example Thanks in advance ...

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...

Where can I get information about the C/C++ linker in Visual Studio?

I'd like to learn more about C/C++ linker issues and troubleshooting in Visual Studio. I've had linker problems crop up from time to time and they are really annoying since you get such limited information from the linker error messages. I've seen a few not-so-detailed MSDN articles but nothing in depth. Where can I find a good source...

Identical build on different systems

I have 3 build machines. One running on windows 2000, one with XP SP3 and one with 64bit Windows Server 2008. And I have a native C++ project to build (I'm building with visual studio 2005 SP1). My goal is to build "exactly" the same dll's using these build machines. By exactly I mean bit by bit (except build timestamp of course). With...

How do I change Outfile name using variable in Visual C++ linker?

In the linker the binary destination is specified as: $(OutDir)\$(ProjectName).exe (example) define method1 1 define method2 5 supposed that method1, method2 is defined in main.h is it possible that output filename will be (method1)_(method2).exe as 1_5.exe ...

How do I change Outfile name using variable in Visual C++ linker?

In the linker the binary destination is specified as: $(OutDir)\$(ProjectName).exe (example) (main.h) (#define method1 1) (#define method2 5) supposed that method1, method2 is defined in main.h is it possible that output filename in the linker will be (method1)_(method2).exe as 1_5.exe ...

Linking against library in release and .exe in debug crashes in Visual studio

I'm using Visual C++ 2008 SP1. I have an app that is compiled in debug mode, but links against a library in release mode. I'm getting a crash at the start-up of the application. To make the problem smaller, I created a simple solution with 2 projects: lib_release (generates a .lib, in release mode) exec_using_lib_release (genereates a...

Why VC++ 2008 compiler takes too much time on link stage?

I have automatic generated code (around 18,000 lines, basically a wrap of data) and other about 2,000 lines code in a C++ project. The project turned on the link-time-optimization operation. /O2 and fast-code optimization. To compile the code, VC++ 2008 express takes incredibly long time (around 1.5 hours). After all, it has only 18,000 ...

linking and using a C++ library with an Objective-C application

I'm writing a graphical application using Objective-C for the front end and C++ for the graphics processing and network communication. I read around on Apple's site looking for a way to link either a .dylib or .so with my C++ code in it to my Xcode project, but nothing seemed to work. I was able to get the project to reference it and lin...

QT cross-platform issue: compiles fine on windows, linker error on linux

I have some QT code called "GUI". Via Qt Creator, I am able to compile (using gcc) it without any complaints on Windows. However, when I try to compile it (again using gcc via Qt Creator) on Linux, I get a linker error "collect2: ld returned 1 exit status". The only non-QT library that I use is the STL's vector library. (To make matt...

Visual-C++ Linker Error

I have a class called MODEL in which public static int theMaxFrames resides. The class is defined in its own header file. theMaxFrames is accessed by a class within the MODEL class and by one function, void set_up(), which is also in the MODEL class. The Render.cpp source file contains a function which calls a function in the Direct3D.cp...

What is the OPTION in the GCC's option "-Wl,OPTION"

When I read the GCC's info manual, I found the link option -Wl,OPTION: `-Wl,OPTION' Pass OPTION as an option to the linker. If OPTION contains commas, it is split into multiple options at the commas. But I could not find the definition of the OPTION. Who can tell me where to find it? I have google it, but nothing found. ...

Where do uninitialized Global Variables go after initializing?

Hi! I struck a little problem when learning. I know that uninitialized global variables in C are assigned to the .bss section in the executable ELF file. But what happens to them when I start to use them? I.e. do they get a place on the heap or somewhere else? I tried to find out by printing the address of the (still uninitialized) glo...

What does the /TSAWARE linker flag do to the PE executable?

After adding the /TSAWARE linker flag to one of my projects (Visual Studio 6), I was surprised to find a new section in the PE file (.idata). If I don't set the flag, the imports are merged into .rdata. To illustrate the "problem" we start out with a simple console program: #include <stdio.h> int main() { printf("hello world\n");...

C++ shared library shows internal symbols

I have built a shared library (.dll, .so) with VC++2008 and GCC. The problem is that inside both libs it shows the names of private symbols (classes, functions) and they weren't exported. I don't want my app to display the name of classes/functions that weren't exported. Is any way i can do that? In GCC i did: Compiled with -fvisibilit...

Are libfoo.a and foo.lib compatabile formats?

Some build scripts (such as the one in numpy) simply does the following to make a gcc-compiled library archive work with the Visual Studio linker: copy libfoo.a foo.lib Surprisingly it seems to work. Does anyone know why? ...

dyld error: image not found

Hi everyone, I got this error message while running my application on simulator. Dyld Error Message: Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit Referenced from: /Users/thomasschober/Excuse Me/build/Distribution-iphonesimulator/Excuse Me.app/Excuse Me Reason: image not found I am not able to ...

MinGW doesn't seem to link against user32

OK. I've been trying to make a program I've been writing in Java be able to find out if the Windows desktop is locked by using JNI. I've succeed in getting JNI working, but the C code I was using at first wasn't returning the correct answer. I got some new code (from here on SO), changed it a little, but I'm having link errors. When li...

Building project involving cmake, how do I make it aware of libraries

When I try to build this project with cmake and gcc on a 64-bit linux (debian) machine, I get an error from the linker: Linking C executable ../../../../cpsadamsx /home/dala/lib64/libSimTKcommon.so: undefined reference to `dlopen' /home/dala/lib64/libSimTKcommon.so: undefined reference to `dlclose' /home/dala/lib64/libSimTKcommon.so: un...

Randomizing function, etc. locations for shared libs

Currently, when I create a shared library, functions from within the same object files like to lie together. Is there a good solution (that does not involve splitting up source files) to try and spread function locations apart? We are currently using a cross-compiled, 4.2.1 version of gcc and the gnu tools. ...