linker

Strategy for handling linker errors?

Given a C++/gpl toolchain, what's a good method or tool to puzzle out linker errors? ...

Why can't the linker prevent the C++ static initialization order fiasco?

EDIT: Changed example below to one that actually demonstrates the SIOF. I am trying to understand all of the subtleties of this problem, because it seems to me to be a major hole in the language. I have read that it cannot be prevented by the linker, but why is this so? It seems trivial to prevent in simple cases, like this: // A.h ...

Undefined reference resulting from g++ linking

Hi there, I am new to g++ and Makefile. I am trying to link this BeBOP SMC library, which is in my lib directory. Under the lib directory are bebop_util and sparse_matrix_converter, both of which have already been built without errors. I see libbebop_util.a, libbebop_util.so under bebop_util and libsparse_matrix_converter.a, libsparse_m...

Is it possible to force an Xcode project to clean before it builds?

Hello everybody, In my Xcode project, I've created a symbolic link script in the target that allows me to edit my scripts and see the updates live. Unfortunately, a side-effect of this is that if I don't clean before building again, I get the following error message: ln: /Users/atg/Desktop/Projects/Xcode Projects/Debug/Xsera.app/Conten...

Error including shared library

Hi there, I am new to g++ and Makefile. I am trying to link this BeBOP SMC library, which is in my lib directory. Under the lib directory are bebop_util and sparse_matrix_converter, both of which have already been built without errors. I see libbebop_util.a, libbebop_util.so under bebop_util and libsparse_matrix_converter.a, libsparse_m...

Unresolved external symbol when lib is linked, compiler adds the letter 'A' to the function name

I get this error when trying to link a win32 exe project. I have linked in the lib that contains the code for this method. But still gets an unresolved symbol error. error LNK2001: unresolved external symbol "public: bool __thiscall SharedJobQueue::AddJobA(class boost::shared_ptr<class domain::Job>)" (?AddJobA@SharedJobQueue@@QAE_NV?$sh...

Linking additional dependencies with XCode

I'm trying to compile a game I made with the Allegro library. The library has .a files which I need to tell XCode to use because right now my code has no errors but it as unreferenced function errors which means it needs the .a files to do the static linking. How do I provide these to XCode? (sort of like the XCode equivalent of MSVC's ...

Linux FreeBSD shared object problem

Hi Guys, I am trying to build an application for freebsd which links to a shared object "share.so" built on linux. I also have freebsd linux compatible libraries under /usr/compat/linux/lib. I am able to compile my application. But while linking to "share.so" I am getting bunch of errors as share.so(built on linux) needs to access librar...

Can I ask VC++ linker to ignore unresolved externals?

I'm trying to build a very complex open-source project with VC++. The project consists of dozens of libraries and one executable depending on those libraries. For some reasons VC++ linker doesn't want to see about 40 functions implemented in one of those libraries and reports "unresolved external reference" on each, so I can't link. I d...

Two .c files have identical compilation settings - VC++ reports no error and doesn't compile one of them

I'm trying to compile a set of .c files from an open source project into a static library. I've created a VC++9 project file, set everything up as usual. I add two .c files into the project. They don't have any special compilation settings - all the settings are set at the project level and are set to default except that I turned off the...

Boost static linking

I am using the Boost library in Linux, GCC. After installing and building the Boost, I found that programs using Regex and Thread use shared Boost libraries. For my purposes, I need static linking. How can I change linking type? Should I rebuild the Boost, or maybe I can set linking type by defining some constant in my own projects or B...

nm: "U" The symbol is undefined

When I nm on one of my libs: nm libmylib.so I get a line like this U _ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4 I checked the man page for nm and I got "U" The symbol is undefined. What does an undefined symbol really mean? If it is really undefined, then why does nm report it at all? ...

Error compiling BASIC "libnotify" code...

#include <libnotify/notify.h> #include <glib.h> #include <unistd.h> int main(int argc, char** argv) { if(argc == 3) { NotifyNotification *n; notify_init("Test"); n = notify_notification_new (argv[1],argv[2], NULL, NULL); notify_notification_set_timeout (n, 3000); //3 seconds if (!notify_not...

Can you statically link the same protobuf message into multiple DLLs - and then have those DLLs work together?

We are using google protobufs to pass data around on the wire. The server side of things is plugin-like so several of the modules handling the protobuf messages are DLLs. Some DLLs depend on others and use the others' messages to define their own messages. So, A.DLL has a.proto which generates a.pb.h/cc with a message class MsgA. Usi...

Mixing GPL and non-GPL Frameworks in software

Hi, so heres my issue. I'm currently developing a program: Lets call it "Program A". There is an existing framework, call it "Framework A", and that framework is GPL licensed. I have also developed another framework, call it "Framework B", this framework does not depend on Program A, or on Framework A. It can stand alone and be used in...

Skip compile-time symbol resolution when building Linux shared libraries with dependencies

Is there a gcc flag to skip resolution of symbols by the compile-time linker when building a shared library (that depends on other shared libraries)? For some reason my toolchain is giving undefined reference errors when I try to build shared library C that depends on B.so and A.so, even though the dependencies are specified and exist. I...

Problem using static library project in WinForm

I have a third party sample sdk havind static library objects and header files in two folders. I have made my own static library project and referred them, after adding my own code i build the project and it succeed. Now i added another project in the same solution but of windows form type. Now when i just add the header file of my class...

Does function-level linking in VC++ have any negative effects?

Visual C++ has function-level linking. Looks like it's a great thing - it can reduce the size of generated executables. Does it have any negative effects? Will I have to pay anything for the advantages of this option or can I just turn it on and enjoy the benefits? ...

Compiling VirtualDiskAPI on cygwin

How can you compile the VirtualDiskAPI on cygwin? I downloaded the windows version of the SDK from here, and put it in my working directory under vmdevkit. I try to compile as follows: gcc -Wall -I./vmdevkit/include -L./vmdevkit/lib -lvixDiskLib -o vmscraper vmscraper.c All my program does is include the files and call connect and dis...

How does function-level linking propagate in VC++?

When I use function-level linking in VC++ for a simple project it's more or less clear how it works. But what if I build an executable that depends on a static library and both are compiled with VC++? For example, if the static library had function-level linking enabled and the executable has it disabled or vice versa - how will it work...