linker

Why would gnu ld link order causes Signal 11 (SEGV) on startup?

We are building a large application in C++ that includes the use of many (static) libraries. We have a problem where the application crashes on startup with a Signal 11, before we even reach main. After much debugging, we have observed that if we explicitly reference an object file so its link order is early, the program crashes on star...

Preventing objects from being linked if they are not needed?

I have an ARM project that I'm building with make. I'm creating the list of object files to link based on the names of all of the .c and .cpp files in my source directory. However, I would like to exclude objects from being linked if they are never used. Will the linker exclude these objects from the .elf file automatically even if I inc...

C++ linking issue on Visual Studio 2008 when crosslinking different projects on same solution

I'm using Google Test Framework to set some unit tests. I have got three projects in my solution: FN (my project) FN_test (my tests) gtest (Google Test Framework) I set FN_test to have FN and gtest as references (dependencies), and then I think I'm ready to set up my tests (I've already set everyone to /MTd (not doing this was leadi...

VC6 linking conflict

I have an old c++ project compiled with VC6. I need to statically link a new library to implement a new functionality. Unfortunately the new library define a symbol (i.e. _inflate) that is already defined in a previously linked static library. Of course I cannot get rid of either library, and of course I have no access to the library'...

Unresolved external symbol while using wpp tracing

Hi, I'm getting the following error message when I try using WPP tracing in my user mode application. 3>hooktest.obj : error LNK2019: unresolved external symbol _WppCleanupUm referenced in function _main 3>hooktest.obj : error LNK2019: unresolved external symbol _WppInitUm referenced in function _main 3>hooktest.obj : error LNK2001: un...

Complete state of a process

hi all, I wrote a small program which is as follows: #include<stdio.h> int c=0; int main() { int a=10,b=20; printf("Hello World\n"); c = a+b; printf("%d\n",c); return 0; } I can create a.out file using the command gcc -save-temps helloworld.c. The save-temps flag allows us to save the intermediate files, helloworl...

Linking Boost to my C++ project in Eclipse

I'm trying to get the Boost library working in my C++ projects in Eclipse. I can successfully build when using header-only libraries in Boost such as the example simple program in the "Getting Started" guide using the lambda header. I cannot get my project to successfully link to the regex Boost library as shown later in the guide. Unde...

Trouble linking libboost libraries to compile sslsniff on RHEL

Trying to build sslsniff on a RHEL 5.2 system here. When compiling sslsniff on RHEL I hit the same errors when using libboost packages (from repositories like rpmforge) and compiling libboost from source (which appeared to be successful.) I tried this on a fresh system as well (no previous/failed/garbage installs of libboost etc.) # mak...

Statically compiling QWebKit 4.6.2

I tried to compile Qt+Webkit statically with MS VS 2008 and this worked. C:\Qt\4.6.2>configure -release -static -opensource -no-fast -no-exceptions -no-accessibility -no-rtti -no-stl -no-opengl -no-openvg -no-incredibuild-xge -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-style-windowsce -no-style-windowsmobi...

Failed to link mysql5.1.39\bin\libmySQL.dll

When trying to link to mysql5.1.39\bin\libmySQL.dll, I get an error: fatal error LNK1107: invalid or corrupt file: cannot read at 0x2D0 Anyone familiar with this? ...

How to force link a static library to another using .vsprops, if possible?

Environment: VS 2008 in Windows. Problem: A static library, say first.lib is not linked to, say second.lib, if first.lib is specified in .vsprops file and none of its functions is referenced in the second.lib. If, however, first.lib is removed from the .vsprops file and placed instead in the appropriate project options dialog(1), it is...

Different ways to specify libraries to gcc/g++

I'd be curious to understand if there's any substantial difference in specifying libraries (both shared and static) to gcc/g++ in the two following ways (CC can be g++ or gcc) CC -o output_executable /path/to/my/libstatic.a /path/to/my/libshared.so source1.cpp source2.cpp ... sourceN.cpp vs CC -o output_executable -L/path/to/my/libs ...

How to link pnglite library in c?

Hi, I installed from kubuntu's package management this handy pnglite library. It contains just one header file "pnglite.h" and one object file "pnglite.o". I have found out where those files are, but I don't know how to link them. I'm using netbeans, but don't know how to link them in there. Also I don't understand how to link them at c...

ld reports missing symbols, but symbols seem to exist

I'm trying to link my mac application to the wonderful libancillary library. However, I have changed the library build script to create a shared library. I can inspect the symbols in this library using nm libancillary.dylib - the result is: libancillary.dylib(single module): U ___sF U __keymgr_get_and_lock_processwide_...

Mac gcc non-virtual thunk error

I'm getting these non-virtual thunk errors only in the Deployment build of my app. It uses a private framework called Lgi. Building on 10.5.8 using XCode 3.1.4 (latest for leopard?) The error looks like this: Ld /Users/matthew/Code/Scribe-Branches/v2.00/build/Development/Scribe.app/Contents/MacOS/Scribe normal i386 cd /Users/matthew...

gcc linker finding both .so and .a in the library path which is chosen?

If I run gcc a.c -L /usr/lib -lexpat and both libexpat.a and libexpat.so are in /usr lib which one is used by the linker? ...

Finding missing symbols in libstdc++ on Debian/squeeze

I'm trying to use a pre-compiled library provided as a .so file. This file is dynamically linked against a few librairies : $ ldd /usr/local/test/lib/libtest.so linux-gate.so.1 => (0xb770d000) libstdc++-libc6.1-1.so.2 => not found libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb75e1000) libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7499000) /l...

Why does the MSCVRT library generate conflicts at link time?

I am building a project in Visual C++ 2008, which is an example MFC-based app for a static C++ class library I will be using in my own project soon. While building the Debug configuration, I get the following: warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library After using the recommende...

Qt Object Linker Problem " undefined reverence to vtable"

This is my header: #ifndef BARELYSOCKET_H #define BARELYSOCKET_H #include <QObject> //! The First Draw of the BarelySocket! class BarelySocket: public QObject { Q_OBJECT public: BarelySocket(); public slots: void sendMessage(Message aMessage); signals: void reciveMessage(Message aMessage); private: // QVector<M...

Linker problem linking boost in Visual Studio 2008

Hi, I have a rather obscure linking problem in Visual Studio 2008. The linker error message is: "LNK1104: cannot open file 'boost_thread-vc90-mt-gd-1_38.lib'". All pathes and dependencies are set. What I noticed though is that Visual Studio misses boost_thread-vc90-mt-gd-1_38.lib and not libboost_thread-vc90-mt-gd-1_38.lib (notice the l...