When you write a Jamfile and make use of the LINKLIBS variable, take care that the libraries are invoked as last parameters when the compiler is called. Here’s a short example from my current coding work
C++ = "g++" ; LINK = "g++" ; Main eop2nc : eop2nc.cpp ReadEOP.cpp WriteEOP.cpp ; LINKLIBS on eop2nc$(SUFEXE) = -lnetcdf_c++ -lnetcdf ;
The third line tells Jam to generate an executable named eop2nc, based on the three files. Dependencies are resolved automatically. The critical point for linking under Linux is found in line 4, where it is explicitly stated that libraries are passed AFTER all the other arguments. See this simple explanation for the importance of the link order. Without this line, compilation is done, but linking fails.