Are all the boost dlls and .lib files needed for the boost compilation? - boost

the total size of the boost dlls and .lib files is coming to around 3.6 gb.I may not use all the dlls and lib files. Assume that I'm only including the Boost/Date and time. Are all the other files needed for the boost compilation ? Are the dlls and the lib files specific to windows and linux ???

You don't need .dlls to compile something at all. Technically, you don't even need .libs to compile; only to link, but I'll assume you meant both. You need .dlls to run however, so I'm not sure what that buys you.
And yes, .dlls and .libs are specific to the platform. And in the case of .libs, the compiler.
the total size of the boost dlls and .lib files is coming to around 3.6 gb.
What configurations did you build for? You only need a debug and a release version. If you built a DLL version, then you don't need to also build a static library version (you'll still get .libs though).
My static-library-only variation takes up ~800MB, and I could probably chop that in half, since I see what appears to be duplication in there.

Related

g++ Argument list too long

I am compiling my code using the MinGW toolchain. I have hundreds of files in my projects, that cannot be changed, so hundreds of object files are produced. During linking the g++.exe command failes because the argument list is too long.
Is there a way to fix this issue under Windows?
Given that it would be interesting to see how the tree of directories of the files is organized, you could divide the project into several libraries and compile them separately.
Later you could statically (or dynamically) to link the various libraries to compile the overall project.

Linking boost libraries C::B Ubuntu

I am trying to link the libraries from boost to C::B. I have built the files but all I see in all the folders are .hpp files. Are there not supposed to be .lib files?
Going through build options, I gave search directories. I am now trying to do the linker settings. What do I put here. It will only take .lib and other files like that. Any ideas?
Which Boost libraries? The vast majority of Boost libraries are header-only. You only need to include the header file to use them. The only Boost libraries that have actual library files are:
Date_Time
Filesystem
Graph
iostreams
Math
Program Options
Random
Regex
Serialization
Signals
System
Thread
Wave
Also, you're working with GCC. Library files end in ".a", not ".lib" as with Visual Studio.

Linking problems on windows (boost)

I'm trying to compile boost and mongodb.
I want 64bit versions, shared libs and dynamic linking to the runtime.
Boost is compiled with link=shared, runtime-link=shared, threading=multi (and some others). The lib and dll files have names like: boost_*-vc90-mt-1_41.dll
Now mongodb has per default set: /MT (multithreaded static). The linker required boost libraries with libboost_*-vc90-mt-s-1_41.dll (notice the additional lib and -s). So I changed the option to /MD (multithreaded dll) and the -sdissapeared but the libstayed. I tried it with /DBOOST_THREAD_USE_DLL /DBOOST_ALL_DYN_LINK but it doesn't change. Does the linker still look for the static libs?
Please help :)
BOOST_ALL_DYN_LINK should have done the trick. Please make sure you rebuild your project from scratch, though.
If the problem still persist, I guess you need to tell what is hiding behind the asterisk -- maybe there's a bug with a specific library.

Sharing boost .hpp files between platforms

I'm not very sure about this and I can't seem to find a complete answer. Some of boost's libraries need to be compiled (thread for example, as well as date time for some uses) - obviously one needs to compile them separately on each platform.
What I am interested in is if the hpp files can be shared between platforms. I'm ultimately seeking a directory structure like this:
boost\
include\
...
libs\
nix\
...
win\
...
So, can I:
use the same thread.hpp include in my linux version and my windows version? (thread.hpp needs a compiled lib)
use the same shared_ptr.hpp include between platforms? (shared_ptr.hpp does not need a compiled lib)
Thanks.
Yes, of course in both cases. The .hpp don't change between platforms (maybe with some preprocessing boost has some differences, but nothing you have to care about).

How to find out why my dll depends on zlib1.dll?

I'm devdeloping a DLL in VS2008. When I examine the DLL in Dependency Walker, I can see a dependency on zlib1.dll. How can I find out where this comes from? My DLL is (statically) linked against HDF5.lib, HDF5_CPP.lib, and GSL.lib. I'm not including any zlib headers, so I'm a bit clueless about this. I know HDF5 depends on zlib, but I tried with the precompiled HDF5 as well as self-compiled HDF5, both to no avail.
The thing is I want to make distribution as easy as possible; that's why I link statically against all libraries I use. Funny thing is, I do link against zlib1.lib; no clue why zlib1.dll is then still a dependency.
Any ideas? Thanks!
Follow the tree within the depends tools.
The right hand tree show the "tree" of module dependency.
Click zlib1.dll in that tree and in the top right hand you will have a list of functions that are being used by the module that links to it. Search in your project to see where you are using them.
zlib1.lib is the dll lib, not the static lib for zlib. You need to obtain the and build the static lib part of the zlib distribution. I havn't built zlib... but some other projects have a xxx.lib and an xxxlib.lib, with the second form being the 'proper' static lib.
On /MT: /MT only effects the c-runtime selection: /MT adds a linker dependency to libc.lib - which statically links the c-runtime into your binary. conversely /MD adds a linker dependency to msvcrt.lib (a lib file) that contains references to msvcr90.dll

Resources