Boost logo

Boost Users :

Subject: Re: [Boost-users] make file starting out
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-08-07 19:33:40


On 08/07/2017 02:54 AM, Peter Koukoulis via Boost-users wrote:
> <snip>
> g++ test_t.o t.o -o test_t
> test_t.o: In function `__static_initialization_and_destruction_0(int, int)':
> test_t.cpp:(.text+0x6e9): undefined reference to `boost::system::generic_category()'
> test_t.cpp:(.text+0x6f5): undefined reference to `boost::system::generic_category()'
> The files look as follows:
> # the makefile:
> CC=g++
> CFLAGS=-c -Wall -std=gnu++14 -lboost_system -lboost_thread -DBOOST_THREAD_VERSION=5 -ldl -lpq
> all: test_t
> test_t: t.o test_t.o
> $(CC) test_t.o t.o -o test_t

Libraries (-lboost_system) need to be passed
to the linker, not the compiler.

In Christ,
Steven Watanabe

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at