linker

Link issues (VC6)

I've opened an old workspace that is a libray and its test harness. It used to work fine but now doesn't and older versions of the code don't work either with the same errors. I've tried recreating the project and that causes the same errors too. Nothing seems out of order in project settings and the code generated works in the main app....

What libraries do I need to link my mixed-mode application to?

I'm integrating .NET support into our C++ application. It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl. I'm not allowed to remove the linker flag "/NODEFAULTLIB". (We have our own build management system, not Visual Studio's.) This means I have to specify all neces...

Best practices for debugging linking errors.

When building projects in C++, I've found debugging linking errors to be tricky, especially when picking up other people's code. What strategies do people use for debugging and fixing linking errors? ...

How do I make a fully statically linked .exe with Visual Studio Express 2005 ?

My current preferred C++ environment is the free and largely excellent Microsoft Visual Studio 2005 Express edition. From time to time I have sent release .exe files to other people with pleasing results. However recently I made the disturbing discovery that the pleasing results were based on more luck that I would like. Attempting to ru...

Linking statically in C#

I'm working on a module for a CMS. This module is distributed as a class library DLL. I have several utility libraries I'd like to use in this module. Is there anyway I can link these libraries statically so I won't have to distribute several DLL's (thereby distributing my utility libraries separately)? I would like to have only one DL...

Mixing C/C++ Libraries

Is it possible for gcc to link against a library that was created with Visual C++? If so, are there any conflicts/problems that might arise from doing so? ...

Linker order - GCC

Why does the order in which libraries are linked sometimes cause errors? ...

Is there a way to parse a dependency tree from a build script output?

I have an inherited project that uses a build script (not make) to build and link the project with various libraries. When it performs a build I would like to parse the build output to determine what and where the actual static libraries being linked into the final executable are and where are they coming from. The script is compiling ...

What's the best tool to graphically display memory layout from a .map file?

My build (gcc) toolchain produces a .map file. Is there a tool to analyze the memory map graphically? ...

VS 2005 & 2008 library linking

Is it correct to link a static library (.lib) compiled with VS 2005 with a program which is compiled with VS 2008? Both library and my program are written in C++. This program is run on Windows Mobile 6 Professional emulator. This seems to work, there are no linking errors. However the program crashes during startup because strange thin...

Visibility of template specialization of C++ function

Suppose I have fileA.h which declares a class classA with template function SomeFunc<T>(). This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of SomeFunc() (like for SomeFunc<int>()) in fileA.C (ie. not in the header file). If I now call SomeFunc<int>() f...

Why do we need extern "C"{ #include <foo.h> } in C++?

Specifically: When should we use it? What is happening at the compiler/linker level that requires us to use it? How in terms of compilation/linking does this solve the problems which require us to use it? ...

Delphi Out of resources

Every project I compile with Delphi 7, in which I do not compile with run-time packages, gives a linker error: "Too many resources". Even a blank application gives this error. In other words: Delphi died on me. ...

Linking .Net Assemblies

This is all hypothetical, so please bear with me. Say I'm writing a tool in C# called Foo. The output is foo.exe. I've found some really great library that I like to use called Bar, which I can reference as bar.dll in my project. When I build my project, I have foo.exe and bar.dll in my output directory. Good so far. What I'd like ...

How best to alleviate scenarios that trigger non-incremental linking (MSVS)

While incremental linking addresses much of the time spent linking, even for very large projects, I find the incremental linker in MSVS to be pretty haphazard. (I'm currently using 2003 atm, would love to hear if 2005/8 addressed any of this.) My list of known triggers include: changing anything external to the main .exe project will...

crti.o file missing

Hey, I'm building a project using a gnu tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.o, wouldn't it use a library file, e.g. libc.a ?? ...

Why Am I Getting Link Errors When Calling Function in Math.h?

When attempting to call functions in math.h, I'm getting link errors like the following undefined reference to sqrt But I'm doing a #include <math.h> I'm using gcc and compiling as follows: gcc -Wall -D_GNU_SOURCE blah.c -o blah Why can't the linker find the definition for sqrt? ...

How to release .Net apps without bundling .Net framework?

I have a strange requirement to ship an application without bundling .Net framework (to save memory footprint and bandwidth). Is this possible? Customers may or may not have .Net runtime installed on their systems. Will doing Ngen take care of this problem? I was looking for something like the good old ways of releasing C++ apps (usin...

Problem Linking "static" Methods in C++

I want to call a few "static" methods of a CPP class defined in a different file but I'm having linking problems. I created a test-case that recreates my problem and the code for it is below. (I'm completely new to C++, I come from a Java background and I'm a little familiar with C.) // CppClass.cpp #include <iostream> #include <pthrea...

Link error when compiling gcc atomic operation in 32-bit mode

I have the following program: ~/test> cat test.cc int main() { int i = 3; int j = __sync_add_and_fetch(&i, 1); return 0; } I'm compiling this program using GCC 4.2.2 on Linux running on a multi-cpu 64-bit Intel machine: ~/test> uname --all Linux doom 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 x86_64 x86_64 GNU/Lin...