linker

undefined references

Hello, I'm trying to compile some fortran code and I'm running into some confusing linking errors. I have some code that I compile and place into a static library: >gfortran -c -I../../inc -o bdout.o bdout.F >ar rv libgeo.a bdout.o I then try to compile against that library with some simple test code and get the following: >gfortran...

Link failure with either abnormal memory consumption or LNK1106 in Visual Studio 2005.

Hello, I am trying to build a solution for windows XP in Visual Studio 2005. This solution contains 81 projects (static libs, exe's, dlls) and is being successfully used by our partners. I copied the solution bundle from their repository and tried setting it up on 3 similar machines of people in our group. I was successful on two machin...

Linker error when compiling boost.asio example

Hi, I'm trying to learn a little bit C++ and Boost.Asio. I'm trying to compile the following code example: #include <iostream> #include <boost/array.hpp> #include <boost/asio.hpp> using boost::asio::ip::tcp; int main(int argc, char* argv[]) { try { if (argc != 2) { std::cerr << "Usage: client <host>" << std::endl; ...

Linking with Boost error

I just downloaded and ran the boost installer for version 1.42 (from boostpro.com), and set up my project according to the getting started guide. However, when I build the program, I get this linker error: LINK : fatal error LNK1104: cannot open file 'libboost_program_options-vc90-mt-gd-1_42.lib' The build log adds this (I've replace...

Undefined reference to ...

I keep getting this error message every time I try to compile, and I cannot find out what the problem is. any help would be greatly appreciated: C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::List()' C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined referenc...

Link User32 with gcc

I have a C program which has a function call that is defined in windows.h (which I have included), however, when I try and compile it with gcc, I get the error: warning: implicit declaration of function `LockWorkStation' I looked at the MSDN documentation and I see that this function is the User32 library file, and I was wondering ho...

Problem with #ifndef and #pragma once

I want write the program with next struct stdafx.h - contains some #define defenitions of program constants and #include of headers wich uses in all project. frmMain.h - contatins code of Form1 also can Show form2 and uses some code from BckHeadr.h and some functions call that headers included in stdafx.h. frmIniPrgs.h - contatins cod...

How to convert a dynamic dll to static lib?

I write a program helloworld.exe; it depends on a.dll. I don't have the source code of the a.dll, which is a dynamic dll. How can i change it to static library, so I can link it into helloworld.exe? ...

Floating point operations in GCC

Hello! Anyone knows where can I find the floating functions for non FPU processor (SH-3) called __mulsf3, __divsf3, __addsf3, __subsf3, __ltsf2 and __floatsisf. I read that those functions are in libgcc but linking against libgcc does not work. Also I read that SH3 devs moved those functions to another lib (maybe libfloat or libgcc_os)....

JNI problem when calling a native library that loads another native library

I've got a bit of an odd problem. I have a project in C++ that's basically a wrapper for a third party DLL like this: MyLibrary --loads DLL_A ----loads DLL_B I load DLL_A with LoadLibrary(), wrap several of its functions and generate my own DLL. I've tested this in a C++ project and a C# project. Both do everything they're supposed to ...

overload glibc function, called from glibc.

Hello I can overload some functions from the shared library, with LD_PRELOAD. But this overloading work only for calls from process itself or from other libraries (?). How can I overload function a, with effect on library internal calls? ...

VS2005 C++: strange linking problem

Hi. I have some strange linking problem in my Visual Studio 2005 C++ project. As always, I declare class in a header and define it's methods in cpp. A have all these files included in my project. And I still have the unresolved external symbol calcWeight. It appears if I actually use this class in my main function. calcWeight() is decla...

C++ extern keyword on functions. Why no just include the header file?

If I understand it correctly this means extern void foo(); that the function foo is declared in another translation unit. 1) Why not just #include the header in which this function is declared? 2) How does the linker know where to look for function at linking time? edit: Maybe I should clarify that the above declaration is then fol...

How to link C# and C++ assemblies into a single executable?

I have VS2008 solution containg a project that generates a C# executable that references a project that generates a dll containing both C++/CLI and unmanaged C++. I would like to merge these into a single executable, as the C++ dll contains security code that I want to embed in the main executable. I cannot use ILMerge, as the dll cont...

link with static library vs individual object files

For a reason i want to unpack a static lib (libx.a) into individual object files (a.o b.o c.o), and specify these object files (a.o b.o c.o) in the linker input list instead of libx.a, with other linker options remaining the same. However, i have noticed the above change has resulted in quite some difference in the output executable. Ba...

GH-Unit for unit testing Objective-C code, why am I getting linking errors?

Hi there, I'm trying to dive into the quite frankly terrible world of unit testing using Xcode (such a convoluted process it seems.) Basically I have this test class, attempting to test my Show.h class #import <GHUnit/GHUnit.h> #import "Show.h" @interface ShowTest : GHTestCase { } @end @implementation ShowTest - (void)testShowCreate {...

static library, but I still need headers?

Hi All, I have a bunch of projects that all could share a "common" static library of classes. What confuses me is if I make a static library out of these classes and link against it in my projects that I still need the headers of the classes in the static library in my main projects. What is the benefit of the static library then? H...

Can I automate the finding of -l parameter I use when linking based on header files (gcc)?

Normally when linking against a static library, I have to specify a library directory and the name of a libX.so (or its symbolic link) as -lX flag for linking [and its directory with -L flag]. Can I automate this based on my header files (in c/c++) only? Or maybe it is not a good idea? Is there a software for locating the -L and -l par...

dlopen / dlsym with as little linking as possible

I have an application which can make use of plugins which are loaded at runtime using dlopen. Each of the plugins defines a function toretrieve the plugin information which is defined using a common structure. Something like that: struct plugin { char *name; char *app_version; int app_verion_id; char *plugin_version; ...

How to relink existing shared library with extra object file

I have existing Linux shared object file (shared library) which has been stripped. I want to produce a new version of the library with some additional functions included. I had hoped that something like the following would work, but does not: ld -o newlib.so newfuncs.o --whole-archive existinglib.so I do not have the source to the exi...