Hello,
I just finished the gigasecond exercise on the C++ track. This exercise requires Boost, which I downloaded and unzipped to a local folder. I added the path to the header files in the INCLUDE
environment variable.
Now when I ran cmake -S . -B build
I got the following error:
Could NOT find Boost (missing: date_time) (found suitable version “1.80.0”,
minimum required is “1.58”)
Which was confusing because it states it found a suitable version, but somehow does not use it. I had similar problems with Boost 1.86.
I was able to fix this, on the Boost website it says:
Most Boost libraries are header-only : they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking.
However CMakeLists.txt
for the gigasecond exercise contains the following sections:
find_package(Boost 1.58 REQUIRED COMPONENTS date_time)
and
# We need boost libraries
target_link_libraries(${exercise}
PRIVATE
Boost::date_time
)
Those sections require library binaries for the date_time
module, which may be there if you compile Boost or could be part of the Boost package (they were not in my case), but for a header-only library are probably not needed.
After commenting out those sections, I could compile and solve the gigasecond exercise.
So my question is: Should CMakeLists.txt
for the gigasecond exercise be updated such that CMAKE does not start looking for library binaries it probably does not need and may not be able to find?
For reference: I am using Windows 11 Home and Visual Studio 2022 Express.