linker

Why isn't this library linking with a pragma comment?

I'm using Fmod in a project I'm working on in Visual C++ 2008. If I include ../fmodapi375win/api/lib/fmodvc.lib in Project->Linker->Input, it works fine, but for some reason if I use #pragma comment(lib,"../fmodapi375win/api/lib/fmodvc.lib") instead it works the same as if that line wasn't there: it builds with no linker errors th...

Mono mkbundle tool unable to create binary with complaint that output file is unavailable.

As per suggestions from this thread on running C# apps sans .NET I've compiled my app using mono. I built the original app using the latest Visual C# .NET Express Edition. It runs fine on .NET on Windows. I then opened up Cygwin and navigated to my source where I compiled the project again, under mono using the following command: $ m...

linking to boost regex in gcc

i am trying to compile my program which uses regex on linux. I built the boost library in the libs/regex/build by typing make -fgcc.mak which created a directory gcc which contains the following four files boost_regex-gcc-1_35 boost_regex-gcc-d-1_35 libboost_regex-gcc-1_35.a libboost_regex-gcc-d-1_35.a Now I want to use regex ...

How to manually decorate linker names in MSVC 2005?

Is there any way to manually decorate function names in MS C++? I'm going to guess any solution would be Microsoft-specific, and I'm cool with that. Alternatively, is there a way to declare the function "??_M@YGXPAXIHP6EX0@Z@Z" so the compiler can understand it? FYI, undname lists it as: void _ _ stdcall `eh vector destructor itera...

C++ linker problem with wrapper

I have a library opengl.lib which contains wrapper functions to all opengl functions. The functions are declared in their own namespace so that the wrapper functions can be named with the same name as the opengl functions. So inside a wrapper function, opengl function is called with ::gl***(); opengl.h: namespace OpenGL { void glFun...

dynamic linker dependenciy info embedded in an archive

Dynamic libraries are nice. The have embedded information in then that help the runtime linker figure what other libraries the final executable needs to load. It also tells the executable what symbols will be loaded Static libraries, however, are a pain in the neck. The linker won't automatically link an archive's dependencies. This...

MAP file analysis - where's my code size comes from?

I am looking for a tool to simplify analysing a linker map file for a large C++ project (VC6). During maintenance, the binaries grow steadily and I want to figure out where it comes from. I suspect some overzealeous template expansion in a library shared between different DLL's, but jsut browsign the map file doesn't give good clues. ...

Is it possible to statically link Qt::phonon on windows?

Because of the dependency on DirectShow on windows, is it possible to use a static Qt with my application? ...

Linking classes in Geany

I am writing a CLI application for Linux in Geany (a C++ IDE). I want to link a simple config file reader class so it can be used in my program. Just including it doesn't work, I get undefined reference errors. I know how to do this in Dev-C++ on Windows, but not Geany. Thanks for helping! ...

Solaris linker equivalent to the GNU LD --export-dynamic flag

Like the question says: We are building on Linux using the GNU linker, and on Solaris using the solaris ld. GNU ld supports the --export-dynamic flag, which: When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynam...

Linker error when trying to use MPMoviePlayer

On a fresh install of XCode 3.1.2, I'm trying to use the iPhone MoviePlayer as shown in the sample code at http://developer.apple.com/iphone/library/codinghowtos/AudioAndVideo/index.html#INITIATE_VIDEO_PLAYBACK_IN_MY_CODE However, XCode reports the following linker errors when I try to build-n-go: Building target “EOY” of project “EOY...

force visual studio to link all symbols in a lib file

Is there any way to force visual studio to link all symbols from a lib file into the dll as atm it is optimizing "unused" functions which are needed by the program using the dll at run time. I tried using the /OPT:NOREF and /OPT:NOICF but they dont seem to work. The reason i need them is because they are global class which register th...

Linker errors with private members of class in header file

Hi. I'm trying to build a project in Visual Studio 2008. I'm getting a bunch of linker errors that are really bothering me. My application is a Win32 console application using only native ANSI C++. They are all linker errors of the same pattern. Linker errors are related to every single private static data member of classes I have defin...

Vector Statistical Library - Math Kernel Library

Could anyone explain me (in plain English) how to link the Vector Statistical Library (included in the Math Kernel Library) to a Fortran 90 source code compiling with Intel Fortran compiler for Linux? My makefile looks as follows: f90comp = ifort libdir = /home/project/ mklpath = /opt/intel/mkl/10.0.5.025/lib/32/ mklinclude = /opt/int...

Override a function call in C

I want to override certain function calls to various APIs for the sake of logging the calls, but I also might want to manipulate data before it is sent to the actual function. For example, say I use a function called getObjectName thousands of times in my source code. I want to temporarily override this function sometimes because I want...

Error with two ways of linking boost regex

I understand that boost regex static library is created with the ar utility by archiving the individual object files. I linked boost regex library by using the -l option in gcc. This worked very well. g++ *.o libboost_regex-gcc-1_37.a -o sairay.out I individually compiled the boost regex source files and then tried to link the object...

on languages that can link to c++

As I was reflecting on this subject, it seemed to me that if a language is implemented in C++, it might well have a mechanism for linking to C++. As I recall, Java is this way through JNI, though I don't really remember if it goes through C++ or plain C. However, it seems that in general languages don't link to C++, and are accessible t...

error LNK2005: already defined - C++

Background I have a project named PersonLibrary which has two files. Person.h Person.cpp This library produces a static library file. Another project is TestProject which uses the PersonLibrary (Added though project dependencies in VS008). Everything worked fine until I added a non-member function to Person.h. Person.h looks like c...

C++ development on linux - where do I start?

I decided to leave my windows install behind and am now running Debian as my default OS. I have always coded in Windows and specifically with Visual Studio. I am currently trying to get used to compiling my code under linux. Although I still have a lot of documentation to read, and don't expect you guys to make it too easy for me, it'd ...

mingw linker can't find PathAppend

When I try to compile the following: #include <windows.h> #include <shlwapi.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { char firstPart[MAX_PATH] = "c:\\windows"; char secondPart[MAX_PATH] = "system32"; PathAppend(firstPart, secondPart); return 0; } Using the command: ...