linker

Is it safe to pass "too many" arguments to a external function?

This situation can only occur without name mangling (I believe), so the below code is C. Say there is a function A defined in A.c as void A(int x, int y){ //Do stuff } Now there is also a separate file B.c: extern "C"{ void A(int x, int y, int z); } void B(){ A(1, 2, 3); } A is initially declared to have only 2 argumen...

DLL linker issue

I am compiling a DLL twice (once for x86, once for x64) and I have set /ENTRY to "DllMain". I am using the /MT runtime library option to statically link against the runtime library. This all work fine when doing the x86 build, but the x64 build fails with this: error LNK2019: unresolved external symbol main referenced in function __tmai...

How do I force Xcode to link to a custom version of a system framework?

I have a project that uses OpenAL. The project is built against the 10.5 SDK, and the version of the OpenAL.framework in 10.5 causes some problems. I want to link to a custom-built version of the OpenAL.framework that resides in my source tree. However, Xcode resolutely refuses to do this. No matter what I try, it insists on linking to ...

When distributing an executable for MacOSX how do I know which versions it will work on? Are there any special build steps for release?

I just built my program for MacOSX using GCC i.e. (gcc main.c). Are there any special build steps I should go through before I distribute the executable, or will it automatically work on all Intel MacOSX systems? ...

iOS4, XCode linking problems

I'm having problems using the QuartzCore framework. Here's the code that's trying to run: #import <QuartzCore/QuartzCore.h> CATransition *animation = [CATransition animation]; [animation setDuration:0.5]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromLeft]; [animation setTimingFunction:[CAMediaTimingFunc...

C++ visual studio inline

Hello! When building projects in Visual Studio (I'm using 2008 SP1) there is an optimizing option called Enable link-time code generation. As far as I understand, this allows specific inlining techniques to be used and that sounds pretty cool. Still, using this option dramatically increases the size of static libraries built. In my cas...

Speed Up linking speed / Fast linking on linux.

Hi, I am building webkit ( 2 Million lines ) after every ten minutes to see the output of my change in it, and linking of webkit on my Machine requires to process 600-700 MB of object files which are there on my hard-disk. That takes around 1.5 minutes. I want to speedup this linking process. Is there any chance that, I can tell os to ...

List code without reference

I use Bold for Delphi with D2007. The model is rather big and now I discover we have many methods in the model that are not called. The compiler should give a hint about it but it is quiet. In Delphi the linker remove methods that do not have any reference. It then give a hint on that when compiling. I try to explain how Bold use method...

Replacing lib with newer one causes symbols to be missing.

Hi, I'm using mobclix lib in an iPhone app, I tried to replace the old lib with a newer one, the old lib contained a class named MobclixAdViewiPhone_300x50, but it has been deprecated and replaced with MobclixAdViewiPhone_320x50, I changed my code to match the library changes, and removed the old library and its headers and added the new...

g++ linker: force static linking if static library exists?

I've a program which links to many libraries. g++, by default, prefers to link to shared libraries , even if corresponding archive exists. How can I change this preference to prefer static archive over dynamic libraries , if a static archive exists. Note , I used '-static' option, but it tries to find static archive for all libraries whi...

three20 error after adding it to my project

I have been trying to add the Three20 framework to my app. But I always end up getting this error: Undefined symbols: "___restore_vfp_d8_d15_regs", referenced from: +[TTEntityTables(TTSingleton) sharedInstance] in libThree20Core.a(TTEntityTables.o) +[TTEntityTables(TTSingleton) releaseSharedInstance] in libThree20Core.a(TTEntityTables.o...

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

boost::gregorian::date

I can't get it to work with visual c++ 2005 and boost 1.43 this simple source code : #include <boost/date_time.hpp> int main( int argc, char** argv ) { boost::gregorian::date d(); } gives a link-time error : error LNK2019: unresolved external symbol "class boost::gregorian::date __cdecl d(void)" (?d@@YA?AVdate@gregorian@boost...

How does Xcode's linker decide where to look for frameworks?

Now I know there are certain standard paths in which the linker looks for frameworks, but where does get it's instructions from, to look in other custom paths? The problem I've got is a warning, something like this: ld: warning: directory '/Path/to/my/Xcode/Project/../../../../../some/other/src/path/no/longer/in/use' following -F not f...

Mangled symbol table in Objective-C when linking static C++ library

I have a class called options written in c++, here is the header info: class Options { public: string filename; string chunkDir; string outFilename; string inFilename; BOOL compress; BOOL extract; BOOL print; BOOL reconstruct; int bits; Options(string inFilename); Options(int argc, char** argv); void unsupported(string s); v...

Linking against boost barfs with 'undefined reference to `boost::system::get_system_category()'

Hi, I'm having trouble statically linking an app which uses the boost 1.35 libraries. I'm using a linux debian Lenny box, with G++ 4.3.2. Linking without -static works without a hitch. Specifically, g++ -Wall -Wextra -pedantic -ggdb3 -O0 -static -l boost_thread-mt -lboost_system-mt -lboost_program_options-mt -lssl -lpthread -l crypt...

Strange behavior for X.cpp/X.hpp files in Integrity

I'm having a project which compiles perfectly with gcc, but fails to compile under Greenhills Integrity environment. The problem boils down to this three files: MyVector.cpp // contains function testVector MyVector.hpp // contains template vector<> SomeFile.cpp MyVector.hpp contains template-class for a vector, and MyVector.cpp conta...

Using a C extern function inside a C++ file: Linking issues with Makefile

Hello, I have an issue. I have defined in C file, read-line.c, a function print, like this: void history_print(void) { /* some stuff */ } In a C++ file, command.cc, I have the following: extern "C" void history_print(void); and then I simply call history_print(). #Use GNU compiler cc = gcc -g CC = g++ -g all: shell tty-r...

A link problem with Windows 7 shell functions

Hello, I'm trying to enumerate files through the Windos 7 library API, e.g. with SHLoadLibraryFromKnownFolder I'm using a C++ win32 console application and getting link errors, e.g., Error LNK2019: unresolved external symbol __imp__DSA_DestroyCallback@12 referenced in function "void __cdecl DSA_DestroyCallback(struct _DSA *,int (__stdc...

Duplicate symbol between two libraries

Hello, I have the following problem: I'm linking against the Admob library which contains some part of the GData API. But I also want to link with the GData static library to use it directly in my own application. Of course, I get duplicate symbols at link time. How can I avoid that? ...