How to create simple Boost.Build make file containing links to libs I use on Windows and Linux?

643 Views Asked by At

main.cpp which should be executable C++ app. It shall depend on

  • Lib1 be a required to be compiled first (before main.cpp) project-lib (with lib1.h and lib1.cpp inside some separate folders)
  • 'Lib2.lib' with its dependency given precompiled libs (like cross-platform OpenCV for example)

I need it to work for Windows and Linux and if possible Mac OS

found for windows: look here - "Common tasks" page 26

exe hello : hello.cpp some_library.lib /some_project//library
          : <threading>multi
          ;

I hoped for better - more readable syntax form Boost creators... And BTW

What the hell on earth does

On Windows, if an application uses shared libraries, and both the application and the libraries are built using Boost.Build, it is not possible to immediately run the application, because the PATH environment variable should include the path to the libraries. It means you have to either add the paths manually, or have the build place the application and the libraries into the same directory.

mean? I can not have a project with 2 nested project - one for .lib and one for app using that .lib?

With this I see how to connect 1 .lib but how to connect a folder with them? And how to connect includes? And when I'll go to Linux what shall be changed?

How should my bjam make/config file look like?

1

There are 1 best solutions below

0
On

It sounds like you want a framework which works on a cross-platform(Multiple operating system) scenario.

Simplest option would be to install cygwin and create a standard makefile for linux. Compile in a cygwin environment to generate the windows equivalent.

You will save substantial time in creating the makefile.

Another option is mksnt.