linker

compiler and linker difference

what is the difference between compiler and linker in c? ...

Altering DLL search path for static linked DLL

I've searched for any hints how I can do this, but all I found was how to redirect a SxS DLL to the local application folder. Here is what I want to accomplish: The (C++) Application.exe is linked to a DLL, Plugin.DLL (dependant project). This DLL is not placed inside the application directory, but in a subfolder called "plugins". As the...

Linker error when compiling iPhone app for Simulator using OGRE libraries

I'm trying to build an iPhone app using the OGRE framework, and I'm getting a linker error when building for the simulator that I'm not sure how to fix. I created the Xcode project using the OGRE iPhone template. I'm using the static libraries for OGRE from the main website, Ogre_iOS_4.0_Dependencies_20100623, and trying to build for t...

initializing a static variable in header

hey everyone. i am new in programming in c, so i am trying all these things just to get the hang of the code. so i worte the following: // file: q7a.h static int err_code = 3; void printErrCode (); ///////////// END OF FILE ///////////////// // file: q7a.c #include <stdio.h> #include "q7a.h" void printErrCode () { printf ("%d ", err_c...

Multiple definitions of my template class

Hi, In my library, I have several initialize() and cleanup() functions, for different modules it depends on. To make this part more safe to use, I decided to follow the RAII rule and built up an Initializer template class, that takes two functions as parameters: // initializer.hpp (include guards omitted) template <void initialize(),...

How can I avoid exceeding the internal ILK size limit in visual studio?

Building a large project in Visual Studio 2005, I am getting an error in incremental linking: LINK : fatal error LNK1210: exceeded internal ILK size limit; link with /INCREMENTAL:NO Do you know of any options other than avoiding incremental linking? In particular, are there practices that will reduce the size of the internal I...

Linking to a .Net v2.0 assembly from a .Net v4.0 assembly also appears to link (and alias) mscorlib v2.0. Why?

I have a .Net assembly which imports an assembly linked against the v2.0 runtime. The problem I'm having is that when I try to run some tests on my assembly, Fusion trys to load the wrong version of a dependent assembly. After looking at the assembly manifest, I can see why: the wrong version of FSharp.Core is linked. In my build file,...

Make Visual Studio 2008 use 8.0 CRT Libraries?

is there a simple way to make Visual Studio 2008 use 8.0 CRT libraries in my c++ project? I really do not want to install Visual Studio 2005 just to do this. Thanks ...

Dynamic Linking in C (lib*.so) library

I have written a code where in it would take in a executable file and the [lib*.so] library as my arguments and link @ Run-time. I want to also take in the function in the (*.o) file @ run-time and link it. But I don't know how to go about it. EDIT 1: The function I'm trying to link is a part of the .o file in the lib*.so library. So I...

32-bit Linux Assembly - Linking files together (gas and ld)

I wrote a function called strlen: .section .text .global strlen .type strlen, @function strlen: ... code ... I assembled this like so: as --32 strlen.asm -o strlen.o Then I wrote a program in asm to print argv which I want to link with this. I assembled that the same way. Now I want to link them together so that the actual program ...

Problems running application compiled with XCode 3.2.4 and iOS SDK 4.1 on iOS 3.x

Hi, I recently ran into troubles building an app with latest iOS 4.1 SDK and running it on device with iOS 3.x. App works OK on 4.x devices and iPad, but crashes on devices running older 3.x iOS. Problem appears to be in linker, since crashes are obviously caused by calls to 3rd party libraries used in the project. The linker (or even ...

Testing iPhone apps effectively with release builds

We have an app that has crashed on armv6 iOS devices coming from the App Store. armv7 iOS devices ran it just fine. When the app was built and tested as debug, it ran just fine on both armv6 and armv7. In the logs, I was getting EXC_BAD_INSTRUCTION when it tried to construct an object from a library. The crash appeared to be a linking er...

Running applications against a different SDK in OS X?

Summary I want to run my cross-compiled application against the 10.5 libraries. Is there an environmental variable that allows this to work? Longer version I cross-compiled my OS X C++ application for a 10.5 target, on a 10.6 host. It compiles fine. The compiled application is linked against libraries like /usr/lib/libstdc++.6.dylib. ...

Calling Haskell from C++ code

I'm currently writing an app in C++ and found that some of its functionality would be better written in Haskell. I've seen instructions on calling Haskell from C code, but is it possible to do the same with C++? EDIT: To clarify, what I'm looking for is a way to compile Haskell code into an external library that g++ can link with the ob...

extern "C" (C linkage) by default

Question Do GCC, MSVC, or Clang, or some combination support setting linkage to default to C? Background I have a large mixed C/C++ project, and while it's easy and logical to export symbols in the C++ sources with C linkage, those same sources are assuming the stuff in the rest of the project are under C++ linkage. The current situa...

In which order does the linker process the library directories?

It is possible that more than one instance of the library exists in the search path during compilation. In what order will linker process directories included in the search path? The platform in question is Sun OS. ...

What is the Visual studio equivalent to GNU ld option --whole-archive

When linking a static library against an executable, unreferenced symbols are normally discarded. In my case some otherwise unused objects are used to register their respective classes into a factory and if the object are discarded, this registration fails. Under Unix where we use gcc, I can pass the flag --whole-archive to the linker l...

cross referencing libraries and linking in C

Hi, I have two C static libraries libA and libB that I link against my executable E. libA has a function that makes a call to a function that is in libB: myLibAFunctionThatCallsAfunctionInLibB( ... ) { libB_function(...); } Both libraries compile fine. My executable E also compiles fine. E is compiled with gcc using -lA -lB flags ...

Templated function being reported as "undefined reference" during compilation

These are my files: --------[ c.hpp ]-------- #ifndef _C #define _C #include<iostream> class C { public: template<class CARTYPE> void call(CARTYPE& c); }; #endif --------[ c.cpp ]-------- #include "c.hpp" template<class CARTYPE> void C::call(CARTYPE& c) { //make use of c somewhere here std::cout<<"Car"<<std::endl; } ...

Static lib loading related problem - please help

Hi all, Suppose I want to version the libs in binaries made. For static libs, I thought this approach would work but it does not: LibInfo.h - Base class for all libinfo classes. Registers an object in gvLibInfo vector when a child is constructed. #ifndef IFACE_H #define IFACE_H #include <vector> class LibInfo; extern std::ve...