linker

Linking Issue While building different binaries

Our codebase has thousands of lines and legacy code. Across time different developers have coded as per their suitability and standards. One of the wrongly implemented code is that a common header is included is declared and defined in different directories to be lined to different binaries with little difference. Ex: dir1/xxx.h class ...

Debug class, c++, linker error

Hello all, I am trying to write a debug class for a project I am working on, and I do not want to have to pass a debug object around so I was trying to do it this way. However, I do not know why my compiler or linker seems to be skipping the implementation I am writing for it. If I add #include "Debug.cpp" to main.cpp this code works j...

Problems linking to a library with gcc

I installed SFML from scratch today so I could work on a game. I downloaded the source, ran sudo make install, tried compiling one of my old projects, and I couldn't get it to link properly. So I tried running a simpler project: one of the samples in the tutorials. I tried to compile this one specifically, but I get these errors: g++ -o...

Why won't this compile (link) with the Q_OBJECT macro in place?

Hi, I made a prototype of a project with PyQt and made it work there, now I'm trying to convert it to C++ and am having some problems. If I don't put the Q_OBJECT macro in, it compiles and works, but if I comment it out, I get the following errors: Undefined symbols: "vtable for MapView", referenced from: MapView::~MapView()in...

Linking with specific library ( libstdc++.so.5 and libstdc++.so.6 )

Hi all, A simple question - is there any way to make the g++ linker to link with a specific libstdc++ library version? I didn't find anything useful in the man page of gcc/g++, neither in other questions here. Here's the situation - my application uses a specific shared library, that's built with libstdc++.so.5 and I want to install a...

Making gcc generate only machine code.

More specifically, I would like to produce a file that I can load into memory (for example with mmap) and then jump to the start of that memory to run the code. Ideally, I'd like the option of either making the code relocatable (which might be inefficient) or specifying an explicit address that the code expects to be loaded at (which is...

In what order does ld-linux.so search shared libraries?

When ld-linux resolves a symbol it searches through the shared libraries in a particular order and stops when it finds a shared library with a matching symbol. What determines the order it searches through the libraries? Does it make a difference if the unresolved symbol is in the main program or in another shared library? How could I ...

Compiling libshout using QT/qmake

I'm trying to link my QT application to a DLL (libshout), while building for Windows. I've added the appropriate lines to my .pro file: LIBS += -L/local/lib -lmp3lame LIBS += -L/local/lib -lshout LIBS += -L/local/lib -logg LIBS += -L/local/lib -lvorbis LIBS += -lwsock32 I've also successfully built and installed libshout to /local/li...

Advantages of implementing a front-end over linking against a library

I want to write a C++ program that plays MP3. Among available MP3 decoding libraries, I chose mpg123. I noticed that, besides being able to link against libmpg123 and make the necessary function calls in my code, the library includes a back-end/front-end interface that enables me to communicate with it's executable, and thus not having ...

The's the meaning of "forces the linker to load all object files from every archive it sees" for Objective-C linker flag OTHER_LD_FLAGS=-all_load?

I read this Q&A: http://stackoverflow.com/questions/2906147/what-does-the-all-load-linker-flag-does So, does this affect runtime loading? Does final program load unnecessary symbols or only for link time? ...

eclipse sfml library issues

I pulled out an application that I wrote in C++ using the sfml library, but I'm having trouble setting up the library in Eclipse. I specified the include path, the lib path and included all the necessary .so libraries to link to. the application compiles fine but it complains at runtime about missing libraries. Why is this happening? Did...

Problem with boost library in C++ project

Hi, I'm attempting to use the boost library in my C++ project (Visual Studio 2008). However on including the boost functions for time: #include <boost/date_time/gregorian/gregorian.hpp> I get the following error (along with a number of warnings): fatal error LNK1104: cannot open file 'libboost_date_time-vc90-mt-gd-1_44.lib' ...

visual studio project dependency on another project LINKING failure

Hi, I have a solution with 2 projects cira_lib and md5_test. One project (cira_lib) is a central library that compiles to a DLL. The other project (md5_test) is an exe with a dependency on cira_lib. When I build md5_test it builds cira_lib first, so I know the project dependencies are being followed. However when VC++ comes to linkin...

gcc/ld - create a new libc.so with __isoc99_sscanf@@GLIBC_2.7 symbol from glibc.2.6

Hello I haw an appl, which do a error: /lib/libc.so.6: version `GLIBC_2.7' not found But the only symbol it needs from glibc 2.7 is __isoc99_sscanf@@GLIBC_2.7 I want to write a small 1 function "library" with this symbol as alias to __sscanf() How can I do this with gcc/ld? My variant is not accepted because "@@" symbols int ...

Can I edit dynamic library (.so) and add an .o to it?

Hello I have a .so dynamic library. Can I link into it an additional object file .o like "ar cr" for .a static libraries? ...

How can I trace a link to see why a symbol got included?

I have two binaries: js and firefox-bin. Both link with libjs_static.a. I have a symbol (javascript_execute__done_semaphore) in libjs_static.a that I want included in both binaries, but it is only appearing in js and not firefox-bin. How can I tell why it got included in js (so I can use that to figure out why it is NOT getting included ...

iPhone static archive lib: Undefined symbol link error

I haven't found a solution for the exact problem I'm having, so perhaps someone here can help me. I've created a static archive library that uses the AVAudioPlayer class and links against the AVFoundation framework. However, when I link my app against this static library, I receive the following linker error: Undefined symbols: "_OBJ...

Header files linked to from header file not found.

Hi everybody I have a problem with Nvidia's OpenCl/Cuda framework, but I think it is a gcc linking issue. The opencl_hello_world.c example file uses following header file: #include "../OpenCL/common/inc/CL/opencl.h" with opencl.h using these header files: #include <../OpenCL/common/inc/CL/cl.h> #include <../OpenCL/common/inc/CL/cl_...

Gcc fails to recognize `-I../path`.

Hi, I have a problem with linking and gcc, probably resulting from a stupid mistake on my side. Drawing from this post Header files linked to from header file not found, I tried the -I option to inlcude header files, but gcc just does not seem to recognize the parameter. ~/Documents/projects/opencl/NVIDIA_GPU_Computing_SDK/src_l$ gcc ...

QT Plugin , VTK QT Widget , Multi-thread and Linking question?

Greetings all, This is going to be a long question,skip the [Background] if its not that neccasary ;) [Background] I am developing a modular QT based application.Application is extentible via QT based plugins. As shown in the figure, there are mainly 3 parts .(numbers in red) 1) libAppCore - the core of the application,which defin...