Boost logo

Boost Users :

From: Olaf Peter (ope-devel_at_[hidden])
Date: 2021-02-28 08:08:38


Hello Boost users

I have here a strange problem which occurs only if I try to build with
precompiled headers using CMake. I've configured the project for use
with dynamically linking. The error is:

/usr/bin/ld:
/usr/lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crt1.o: in
function `_start':
(.text+0x24): undefined reference to `main'

Something obvious?

Thanks in advance

The project's reduce is:

---8<--- test_driver.cpp --- 8< ----

#defineBOOST_TEST_MODULE "My Test Suite"

#include<boost/test/unit_test.hpp>
--->8------>8------>8---

---8<--- test_x.cpp --- 8< ----

#include<boost/test/unit_test.hpp>
....
--->8------>8------>8---

---8<--- src/CMakeLists.txt --- 8< ----

...

set_source_files_properties(src/test_xxx.cpp

APPEND PROPERTIES
COMPILE_DEFINITIONS "BOOST_TEST_DYN_LINK"
)
....
--->8------>8------>8------>8------>8------>8---

---8<--- pch.pp --- 8< ----

#pragma once
#include<boost/test/unit_test.hpp>
--->8------>8------>8---


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net