Can Boost 1.65.x be used with Visual C++ 2010? - visual-studio-2010

I got the Boost 64-bit Windows Installer for VC++ 2010 (boost_1_65_0-msvc-10.0-64.exe) from https://sourceforge.net/projects/boost/files/boost-binaries/1.65.0/.
The Include and Library path settings in the project are correct.
Trying to use it in a x64 Console project results in several build errors - I am only using the thread class here. These are the errors I get:
1>------ Build started: Project: CPSS, Configuration: Debug x64 ------
1> stdafx.cpp
1> SockServer.cpp
1> Linking to lib file: libboost_thread-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_date_time-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_system-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/system/error_code.hpp(255): warning C4355: 'this' : used in base member initializer list
1> Linking to lib file: libboost_chrono-vc100-mt-gd-1_65.lib
1> CPSS.cpp
1> Linking to lib file: libboost_thread-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_date_time-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_system-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/system/error_code.hpp(255): warning C4355: 'this' : used in base member initializer list
1> Linking to lib file: libboost_chrono-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/thread/detail/thread.hpp(271): error C2752: 'boost::move_detail::remove_reference<T>' : more than one partial specialization matches the template argument list
1> with
1> [
1> T=int (__cdecl &)(void)
1> ]
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/detail/meta_utils.hpp(105): could be 'boost::move_detail::remove_reference<T&&>'
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/detail/meta_utils.hpp(97): or 'boost::move_detail::remove_reference<T&>'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared(13) : see reference to function template instantiation 'boost::thread::thread<int(__cdecl &)(void)>(F)' being compiled
1> with
1> [
1> F=int (__cdecl &)(void)
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared(35) : see reference to function template instantiation 'std::tr1::_Ref_count_obj<_Ty>::_Ref_count_obj<int(__cdecl &)(void)>(_Arg0)' being compiled
1> with
1> [
1> _Ty=thread_t,
1> _Arg0=int (__cdecl &)(void)
1> ]
1> CPSS.cpp(34) : see reference to function template instantiation 'std::tr1::shared_ptr<_Ty> std::tr1::make_shared<thread_t,int(__cdecl &)(void)>(_Arg0)' being compiled
1> with
1> [
1> _Ty=thread_t,
1> _Arg0=int (__cdecl &)(void)
1> ]
1>E:\hld\Src\Boost\boost_1_65_0\boost/thread/detail/thread.hpp(271): error C2668: 'boost::forward' : ambiguous call to overloaded function
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/utility_core.hpp(252): could be 'T boost::forward<F>(int (__cdecl &)(void))'
1> with
1> [
1> T=int (__cdecl &)(void),
1> F=int (__cdecl &)(void)
1> ]
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/utility_core.hpp(248): or 'T boost::forward<F>(int (__cdecl &)(void))'
1> with
1> [
1> T=int (__cdecl &)(void),
1> F=int (__cdecl &)(void)
1> ]
1> while trying to match the argument list '(int (__cdecl &)(void))'
1> SockServerEx.cpp
1> Linking to lib file: libboost_thread-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_date_time-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_system-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/system/error_code.hpp(255): warning C4355: 'this' : used in base member initializer list
1> Linking to lib file: libboost_chrono-vc100-mt-gd-1_65.lib
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm using the nuget package boost-vc100, version 1.65.1.0 on a windows 7, x86 without problems.

Related

Cannot instal pg_query 1.3.0 with bundle install, mac M1 latest

I am new to this, I should install everything with bundle install and I am stuck at the pg_query 1.3.0 gem. It seems to show me error
linking shared-object pg_query/pg_query.bundle
ld: library not found for -lpg_query
clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pg_query.bundle] Error 1`
This is the whole log after bundle install:
Fetching pg_query 1.3.0
Installing pg_query 1.3.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/dominikkrautstengel/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/pg_query-1.3.0/ext/pg_query
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/bin/ruby -I /Users/dominikkrautstengel/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r
./siteconf20221123-20970-12vwdyo.rb extconf.rb
compiling src/pg_query.c
compiling src/pg_query_fingerprint.c
compiling src/pg_query_json.c
compiling src/pg_query_json_plpgsql.c
compiling src/pg_query_normalize.c
compiling src/pg_query_parse.c
compiling src/pg_query_parse_plpgsql.c
compiling src/postgres/contrib_pgcrypto_sha1.c
compiling src/postgres/src_backend_catalog_namespace.c
compiling src/postgres/src_backend_catalog_pg_proc.c
compiling src/postgres/src_backend_lib_stringinfo.c
compiling src/postgres/src_backend_libpq_pqcomm.c
compiling src/postgres/src_backend_nodes_bitmapset.c
compiling src/postgres/src_backend_nodes_copyfuncs.c
compiling src/postgres/src_backend_nodes_equalfuncs.c
compiling src/postgres/src_backend_nodes_extensible.c
compiling src/postgres/src_backend_nodes_list.c
compiling src/postgres/src_backend_nodes_makefuncs.c
compiling src/postgres/src_backend_nodes_nodeFuncs.c
compiling src/postgres/src_backend_nodes_value.c
compiling src/postgres/src_backend_parser_gram.c
In file included from gram.y:46:
In file included from ./src/postgres/include/postgres.h:47:
In file included from ./src/postgres/include/c.h:1224:
In file included from ./src/postgres/include/port.h:17:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netdb.h:91:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/in.h:81:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socket.h:425:1: error:
expected ';' after top level declarator
__CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr, sockaddr);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:587:101:
note: expanded from macro '__CCT_DECLARE_CONSTRAINED_PTR_TYPES'
#define __CCT_DECLARE_CONSTRAINED_PTR_TYPES(basetype, basetag) \
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:580:2:
note: expanded from macro '\
__CCT_DECLARE_CONSTRAINED_PTR_TYPE'
__CCT_DISPATCH(__CCT_DECLARE_CONSTRAINED_PTR_TYPE, basetype, basetag, __VA_ARGS__)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:548:2:
note: expanded from macro '__CCT_DISPATCH'
__CCT_DISPATCH1(base, __CCT_COUNT_ARGS(__VA_ARGS__), __VA_ARGS__)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:113:26: note:
expanded from macro '__CONCAT'
#define __CONCAT(x, y) x ## y
^
<scratch space>:415:1: note: expanded from here
__CCT_DECLARE_CONSTRAINED_PTR_TYPE_3
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:563:14:
note: expanded from macro '__CCT_DECLARE_CONSTRAINED_PTR_TYPE_3'
__CCT_DEFER(__CONCAT, basetag, __CCT_CONTRACT_LIST_TO_TAGGED_SUFFIX_1(kind))
^
In file included from gram.y:46:
In file included from ./src/postgres/include/postgres.h:47:
In file included from ./src/postgres/include/c.h:1224:
In file included from ./src/postgres/include/port.h:17:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netdb.h:91:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/in.h:81:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socket.h:425:1: error:
expected ';' after top level declarator
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:588:101:
note: expanded from macro '__CCT_DECLARE_CONSTRAINED_PTR_TYPES'
__CCT_DECLARE_CONSTRAINED_PTR_TYPE(basetype, basetag, REF); \
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:580:2:
note: expanded from macro '\
__CCT_DECLARE_CONSTRAINED_PTR_TYPE'
__CCT_DISPATCH(__CCT_DECLARE_CONSTRAINED_PTR_TYPE, basetype, basetag, __VA_ARGS__)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:548:2:
note: expanded from macro '__CCT_DISPATCH'
__CCT_DISPATCH1(base, __CCT_COUNT_ARGS(__VA_ARGS__), __VA_ARGS__)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:113:26: note:
expanded from macro '__CONCAT'
#define __CONCAT(x, y) x ## y
^
<scratch space>:420:1: note: expanded from here
__CCT_DECLARE_CONSTRAINED_PTR_TYPE_4
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:567:11:
note: expanded from macro '__CCT_DECLARE_CONSTRAINED_PTR_TYPE_4'
* __CCT_CONTRACT_TO_ATTR(kind2) \
^
In file included from gram.y:46:
In file included from ./src/postgres/include/postgres.h:47:
In file included from ./src/postgres/include/c.h:1224:
In file included from ./src/postgres/include/port.h:17:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netdb.h:91:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/in.h:81:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socket.h:471:1: error:
typedef redefinition with different types ('struct sockaddr_storage *' vs 'struct sockaddr *')
__CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:587:101:
note: expanded from macro '__CCT_DECLARE_CONSTRAINED_PTR_TYPES'
#define __CCT_DECLARE_CONSTRAINED_PTR_TYPES(basetype, basetag) \
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:580:2:
note: expanded from macro '\
__CCT_DECLARE_CONSTRAINED_PTR_TYPE'
__CCT_DISPATCH(__CCT_DECLARE_CONSTRAINED_PTR_TYPE, basetype, basetag, __VA_ARGS__)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:548:2:
note: expanded from macro '__CCT_DISPATCH'
__CCT_DISPATCH1(base, __CCT_COUNT_ARGS(__VA_ARGS__), __VA_ARGS__)
^
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/constrained_ctypes.h:540:38:
note: expanded from macro '__CCT_CONTRACT_TO_ATTR'
#define __CCT_CONTRACT_TO_ATTR(kind) __CONCAT(__CCT_CONTRACT_ATTR_, kind)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:113:26: note:
expanded from macro '__CONCAT'
#define __CONCAT(x, y) x ## y
pg_query_ruby.c:63:41: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
cPgQuery = rb_const_get(rb_cObject, rb_intern("PgQuery"));
^~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
}
^
pg_query_ruby.c:63:41: note: ')' token is here
cPgQuery = rb_const_get(rb_cObject, rb_intern("PgQuery"));
^~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
pg_query_ruby.c:64:42: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
cParseError = rb_const_get_at(cPgQuery, rb_intern("ParseError"));
^~~~~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
pg_query_ruby.c:64:42: note: '{' token is here
cParseError = rb_const_get_at(cPgQuery, rb_intern("ParseError"));
^~~~~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
{ \
^
pg_query_ruby.c:64:42: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts
[-Wcompound-token-split-by-macro]
cParseError = rb_const_get_at(cPgQuery, rb_intern("ParseError"));
^~~~~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
}
^
pg_query_ruby.c:64:42: note: ')' token is here
cParseError = rb_const_get_at(cPgQuery, rb_intern("ParseError"));
^~~~~~~~~~~~~~~~~~~~~~~
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
pg_query_ruby.c:59:1: warning: function 'raise_ruby_fingerprint_error' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
17 warnings generated.
linking shared-object pg_query/pg_query.bundle
ld: library not found for -lpg_query
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pg_query.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/dominikkrautstengel/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/pg_query-1.3.0 for inspection.
Results logged to
/Users/dominikkrautstengel/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/extensions/arm64-darwin-22/2.7.0/pg_query-1.3.0/gem_make.out
An error occurred while installing pg_query (1.3.0), and Bundler cannot continue.
Make sure that `gem install pg_query -v '1.3.0'` succeeds before bundling.
In Gemfile:
prosopite was resolved to 0.2.1, which depends on
pg_query
I have latest Xcode installed and Command Line Tools also. But as I said, I do not understand any of this, this is just my assignment to be able to run on local.

Can't find Boost using Visual Studio 2019 and GitHub actions

Trying to install Boost as static library, so I can include it in my binary to not need to install it on system. But it seems to failed of this error below:
Run cmake . -G "Visual Studio 16 2019" -B build -DSTATIC=true
-DDO_TESTS=OFF -DCMAKE_C_FLAGS="-fassociative-math" -DCMAKE_CXX_FLAGS="-fassociative-math" -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=C:\boost_1_74_0\boost_1_74_0
-- The C compiler identification is MSVC 19.29.30147.0
-- The CXX compiler identification is MSVC 19.29.30147.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
- skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
- skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE CMake Warning (dev) at CMakeLists.txt:43 (set): implicitly converting 'TYPE' to 'STRING' type.
-- FORCE_USE_HEAP: ENABLED This warning is for project developers. Use -Wno-dev to suppress it.
-- HW AES: ENABLED
-- OPTIMIZED_ARM_MULTIPLICATION: ENABLED
-- Found Git: C:/Program Files/Git/bin/git.exe CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Boost (missing: system filesystem thread date_time chrono regex serialization program_options) (found version "1.74.0") Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args) CMakeLists.txt:270 (find_package)
-- Configuring incomplete, errors occurred! See also "D:/a/kryptokrona/kryptokrona/build/CMakeFiles/CMakeOutput.log". See also "D:/a/kryptokrona/kryptokrona/build/CMakeFiles/CMakeError.log". Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist. Switch: ALL_BUILD.vcxproj Error: Process completed with exit code 1.
So this is how I set it up in CMake:
# Go get us some static BOOST libraries
set(Boost_NO_BOOST_CMAKE ON)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
# Checker if we build on GitHub Actions and building for Visual C++
if(DEFINED ENV{CI} AND MSVC)
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_NO_SYSTEM_PATHS ON)
else()
set(Boost_USE_STATIC_RUNTIME ON) # ON was before
endif()
In GitHub workflow:
# install dependencies
- name: Install Windows 2019 Dependencies
if: matrix.config.os == 'windows-2019'
uses: microsoft/setup-msbuild#v1.1
with:
msbuild-architecture: x64
- name: Install Windows Boost
if: matrix.config.os == 'windows-2019'
run: |
Invoke-WebRequest -Uri https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.zip -OutFile C:\boost_1_74_0.zip
Expand-Archive C:\boost_1_74_0.zip -DestinationPath C:\boost_1_74_0
Set-Location C:\boost_1_74_0\boost_1_74_0\tools\build
C:\boost_1_74_0\boost_1_74_0\tools\build\bootstrap.bat
.\b2 toolset=msvc variant=release optimization=space threading=multi link=static address-model=64 install
- name: Build Windows 2019
if: matrix.config.os == 'windows-2019'
run: |
cmake . -G "Visual Studio 16 2019" -B build -DSTATIC=true -DDO_TESTS=OFF -DCMAKE_C_FLAGS="-fassociative-math" -DCMAKE_CXX_FLAGS="-fassociative-math" -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=C:\boost_1_74_0\boost_1_74_0
cmake --build ./build --config Release
How can I make this work to load Boost so it loads Boosts? It works on macOS and Ubuntu since I install them system wide first. But then compile it as static.
After passing debug options on for Boost this is the output:
- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1689 ] _boost_TEST_VERSIONS = "1.80.0;1.80;1.79.0;1.79;1.78.0;1.78;1.77.0;1.77;1.76.0;1.76;1.75.0;1.75;1.74.0;1.74;1.73.0;1.73;1.72.0;1.72;1.71.0;1.71;1.70.0;1.70;1.69.0;1.69;1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1690 ] Boost_USE_MULTITHREADED = "ON"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1691 ] Boost_USE_STATIC_LIBS = "ON"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1692 ] Boost_USE_STATIC_RUNTIME = "ON"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1693 ] Boost_ADDITIONAL_VERSIONS = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1694 ] Boost_NO_SYSTEM_PATHS = "ON"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1726 ] BOOST_ROOT = "C:\boost_1_74_0\boost_1_74_0"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1727 ] ENV{BOOST_ROOT} = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1728 ] BOOST_INCLUDEDIR = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1729 ] ENV{BOOST_INCLUDEDIR} = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1730 ] BOOST_LIBRARYDIR = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1731 ] ENV{BOOST_LIBRARYDIR} = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1803 ] _boost_INCLUDE_SEARCH_DIRS = "C:\boost_1_74_0\boost_1_74_0/include;C:\boost_1_74_0\boost_1_74_0;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1804 ] _boost_PATH_SUFFIXES = "boost-1_80_0;boost_1_80_0;boost/boost-1_80_0;boost/boost_1_80_0;boost-1_80;boost_1_80;boost/boost-1_80;boost/boost_1_80;boost-1_79_0;boost_1_79_0;boost/boost-1_79_0;boost/boost_1_79_0;boost-1_79;boost_1_79;boost/boost-1_79;boost/boost_1_79;boost-1_78_0;boost_1_78_0;boost/boost-1_78_0;boost/boost_1_78_0;boost-1_78;boost_1_78;boost/boost-1_78;boost/boost_1_78;boost-1_77_0;boost_1_77_0;boost/boost-1_77_0;boost/boost_1_77_0;boost-1_77;boost_1_77;boost/boost-1_77;boost/boost_1_77;boost-1_76_0;boost_1_76_0;boost/boost-1_76_0;boost/boost_1_76_0;boost-1_76;boost_1_76;boost/boost-1_76;boost/boost_1_76;boost-1_75_0;boost_1_75_0;boost/boost-1_75_0;boost/boost_1_75_0;boost-1_75;boost_1_75;boost/boost-1_75;boost/boost_1_75;boost-1_74_0;boost_1_74_0;boost/boost-1_74_0;boost/boost_1_74_0;boost-1_74;boost_1_74;boost/boost-1_74;boost/boost_1_74;boost-1_73_0;boost_1_73_0;boost/boost-1_73_0;boost/boost_1_73_0;boost-1_73;boost_1_7...
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1819 ] location of version.hpp: C:/boost_1_74_0/boost_1_74_0/boost/version.hpp
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1859 ] Boost_VERSION = "107400"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1860 ] Boost_VERSION_STRING = "1.74.0"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1861 ] Boost_VERSION_MACRO = "107400"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1862 ] Boost_VERSION_MAJOR = "1"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1863 ] Boost_VERSION_MINOR = "74"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1864 ] Boost_VERSION_PATCH = "0"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1865 ] Boost_VERSION_COUNT = "3"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1889 ] Boost_LIB_PREFIX = "lib"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1890 ] Boost_NAMESPACE = "boost"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:953 ] _boost_COMPILER = "-vc142;-vc141;-vc140" (guessed)
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1926 ] _boost_MULTITHREADED = "-mt"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2004 ] _boost_ARCHITECTURE_TAG = "-x64" (detected)
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2008 ] _boost_RELEASE_ABI_TAG = "-s"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2009 ] _boost_DEBUG_ABI_TAG = "-sgd"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2069 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = "C:\boost_1_74_0\boost_1_74_0/lib;C:\boost_1_74_0\boost_1_74_0/stage/lib;C:\boost_1_74_0\boost_1_74_0/lib64-msvc-14.2;C:\boost_1_74_0\boost_1_74_0/lib64-msvc-14.1;C:\boost_1_74_0\boost_1_74_0/lib64-msvc-14.0;C:/boost_1_74_0/boost_1_74_0/lib;C:/boost_1_74_0/boost_1_74_0/../lib;C:/boost_1_74_0/boost_1_74_0/stage/lib;C:/boost_1_74_0/boost_1_74_0/../lib64-msvc-14.2;C:/boost_1_74_0/boost_1_74_0/../lib64-msvc-14.1;C:/boost_1_74_0/boost_1_74_0/../lib64-msvc-14.0;C:/boost_1_74_0/boost_1_74_0/lib64-msvc-14.2;C:/boost_1_74_0/boost_1_74_0/lib64-msvc-14.1;C:/boost_1_74_0/boost_1_74_0/lib64-msvc-14.0;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2070 ] _boost_LIBRARY_SEARCH_DIRS_DEBUG = "C:\boost_1_74_0\boost_1_74_0/lib;C:\boost_1_74_0\boost_1_74_0/stage/lib;C:\boost_1_74_0\boost_1_74_0/lib64-msvc-14.2;C:\boost_1_74_0\boost_1_74_0/lib64-msvc-14.1;C:\boost_1_74_0\boost_1_74_0/lib64-msvc-14.0;C:/boost_1_74_0/boost_1_74_0/lib;C:/boost_1_74_0/boost_1_74_0/../lib;C:/boost_1_74_0/boost_1_74_0/stage/lib;C:/boost_1_74_0/boost_1_74_0/../lib64-msvc-14.2;C:/boost_1_74_0/boost_1_74_0/../lib64-msvc-14.1;C:/boost_1_74_0/boost_1_74_0/../lib64-msvc-14.0;C:/boost_1_74_0/boost_1_74_0/lib64-msvc-14.2;C:/boost_1_74_0/boost_1_74_0/lib64-msvc-14.1;C:/boost_1_74_0/boost_1_74_0/lib64-msvc-14.0;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH"
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for SYSTEM_LIBRARY_RELEASE: libboost_system-vc142-mt-s-x64-1_74;libboost_system-vc142-mt-s-x64;libboost_system-vc142-mt-s;libboost_system-vc141-mt-s-x64-1_74;libboost_system-vc141-mt-s-x64;libboost_system-vc141-mt-s;libboost_system-vc140-mt-s-x64-1_74;libboost_system-vc140-mt-s-x64;libboost_system-vc140-mt-s;libboost_system-mt-s-x64-1_74;libboost_system-mt-s-x64;libboost_system-mt-s;libboost_system-mt;libboost_system
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-vc142-mt-sgd-x64-1_74;libboost_system-vc142-mt-sgd-x64;libboost_system-vc142-mt-sgd;libboost_system-vc141-mt-sgd-x64-1_74;libboost_system-vc141-mt-sgd-x64;libboost_system-vc141-mt-sgd;libboost_system-vc140-mt-sgd-x64-1_74;libboost_system-vc140-mt-sgd-x64;libboost_system-vc140-mt-sgd;libboost_system-mt-sgd-x64-1_74;libboost_system-mt-sgd-x64;libboost_system-mt-sgd;libboost_system-mt;libboost_system
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for FILESYSTEM_LIBRARY_RELEASE: libboost_filesystem-vc142-mt-s-x64-1_74;libboost_filesystem-vc142-mt-s-x64;libboost_filesystem-vc142-mt-s;libboost_filesystem-vc141-mt-s-x64-1_74;libboost_filesystem-vc141-mt-s-x64;libboost_filesystem-vc141-mt-s;libboost_filesystem-vc140-mt-s-x64-1_74;libboost_filesystem-vc140-mt-s-x64;libboost_filesystem-vc140-mt-s;libboost_filesystem-mt-s-x64-1_74;libboost_filesystem-mt-s-x64;libboost_filesystem-mt-s;libboost_filesystem-mt;libboost_filesystem
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for FILESYSTEM_LIBRARY_DEBUG: libboost_filesystem-vc142-mt-sgd-x64-1_74;libboost_filesystem-vc142-mt-sgd-x64;libboost_filesystem-vc142-mt-sgd;libboost_filesystem-vc141-mt-sgd-x64-1_74;libboost_filesystem-vc141-mt-sgd-x64;libboost_filesystem-vc141-mt-sgd;libboost_filesystem-vc140-mt-sgd-x64-1_74;libboost_filesystem-vc140-mt-sgd-x64;libboost_filesystem-vc140-mt-sgd;libboost_filesystem-mt-sgd-x64-1_74;libboost_filesystem-mt-sgd-x64;libboost_filesystem-mt-sgd;libboost_filesystem-mt;libboost_filesystem
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for THREAD_LIBRARY_RELEASE: libboost_thread-vc142-mt-s-x64-1_74;libboost_thread-vc142-mt-s-x64;libboost_thread-vc142-mt-s;libboost_thread-vc141-mt-s-x64-1_74;libboost_thread-vc141-mt-s-x64;libboost_thread-vc141-mt-s;libboost_thread-vc140-mt-s-x64-1_74;libboost_thread-vc140-mt-s-x64;libboost_thread-vc140-mt-s;libboost_thread-mt-s-x64-1_74;libboost_thread-mt-s-x64;libboost_thread-mt-s;libboost_thread-mt;libboost_thread
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for THREAD_LIBRARY_DEBUG: libboost_thread-vc142-mt-sgd-x64-1_74;libboost_thread-vc142-mt-sgd-x64;libboost_thread-vc142-mt-sgd;libboost_thread-vc141-mt-sgd-x64-1_74;libboost_thread-vc141-mt-sgd-x64;libboost_thread-vc141-mt-sgd;libboost_thread-vc140-mt-sgd-x64-1_74;libboost_thread-vc140-mt-sgd-x64;libboost_thread-vc140-mt-sgd;libboost_thread-mt-sgd-x64-1_74;libboost_thread-mt-sgd-x64;libboost_thread-mt-sgd;libboost_thread-mt;libboost_thread
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for DATE_TIME_LIBRARY_RELEASE: libboost_date_time-vc142-mt-s-x64-1_74;libboost_date_time-vc142-mt-s-x64;libboost_date_time-vc142-mt-s;libboost_date_time-vc141-mt-s-x64-1_74;libboost_date_time-vc141-mt-s-x64;libboost_date_time-vc141-mt-s;libboost_date_time-vc140-mt-s-x64-1_74;libboost_date_time-vc140-mt-s-x64;libboost_date_time-vc140-mt-s;libboost_date_time-mt-s-x64-1_74;libboost_date_time-mt-s-x64;libboost_date_time-mt-s;libboost_date_time-mt;libboost_date_time
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for DATE_TIME_LIBRARY_DEBUG: libboost_date_time-vc142-mt-sgd-x64-1_74;libboost_date_time-vc142-mt-sgd-x64;libboost_date_time-vc142-mt-sgd;libboost_date_time-vc141-mt-sgd-x64-1_74;libboost_date_time-vc141-mt-sgd-x64;libboost_date_time-vc141-mt-sgd;libboost_date_time-vc140-mt-sgd-x64-1_74;libboost_date_time-vc140-mt-sgd-x64;libboost_date_time-vc140-mt-sgd;libboost_date_time-mt-sgd-x64-1_74;libboost_date_time-mt-sgd-x64;libboost_date_time-mt-sgd;libboost_date_time-mt;libboost_date_time
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for CHRONO_LIBRARY_RELEASE: libboost_chrono-vc142-mt-s-x64-1_74;libboost_chrono-vc142-mt-s-x64;libboost_chrono-vc142-mt-s;libboost_chrono-vc141-mt-s-x64-1_74;libboost_chrono-vc141-mt-s-x64;libboost_chrono-vc141-mt-s;libboost_chrono-vc140-mt-s-x64-1_74;libboost_chrono-vc140-mt-s-x64;libboost_chrono-vc140-mt-s;libboost_chrono-mt-s-x64-1_74;libboost_chrono-mt-s-x64;libboost_chrono-mt-s;libboost_chrono-mt;libboost_chrono
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for CHRONO_LIBRARY_DEBUG: libboost_chrono-vc142-mt-sgd-x64-1_74;libboost_chrono-vc142-mt-sgd-x64;libboost_chrono-vc142-mt-sgd;libboost_chrono-vc141-mt-sgd-x64-1_74;libboost_chrono-vc141-mt-sgd-x64;libboost_chrono-vc141-mt-sgd;libboost_chrono-vc140-mt-sgd-x64-1_74;libboost_chrono-vc140-mt-sgd-x64;libboost_chrono-vc140-mt-sgd;libboost_chrono-mt-sgd-x64-1_74;libboost_chrono-mt-sgd-x64;libboost_chrono-mt-sgd;libboost_chrono-mt;libboost_chrono
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for REGEX_LIBRARY_RELEASE: libboost_regex-vc142-mt-s-x64-1_74;libboost_regex-vc142-mt-s-x64;libboost_regex-vc142-mt-s;libboost_regex-vc141-mt-s-x64-1_74;libboost_regex-vc141-mt-s-x64;libboost_regex-vc141-mt-s;libboost_regex-vc140-mt-s-x64-1_74;libboost_regex-vc140-mt-s-x64;libboost_regex-vc140-mt-s;libboost_regex-mt-s-x64-1_74;libboost_regex-mt-s-x64;libboost_regex-mt-s;libboost_regex-mt;libboost_regex
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for REGEX_LIBRARY_DEBUG: libboost_regex-vc142-mt-sgd-x64-1_74;libboost_regex-vc142-mt-sgd-x64;libboost_regex-vc142-mt-sgd;libboost_regex-vc141-mt-sgd-x64-1_74;libboost_regex-vc141-mt-sgd-x64;libboost_regex-vc141-mt-sgd;libboost_regex-vc140-mt-sgd-x64-1_74;libboost_regex-vc140-mt-sgd-x64;libboost_regex-vc140-mt-sgd;libboost_regex-mt-sgd-x64-1_74;libboost_regex-mt-sgd-x64;libboost_regex-mt-sgd;libboost_regex-mt;libboost_regex
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for SERIALIZATION_LIBRARY_RELEASE: libboost_serialization-vc142-mt-s-x64-1_74;libboost_serialization-vc142-mt-s-x64;libboost_serialization-vc142-mt-s;libboost_serialization-vc141-mt-s-x64-1_74;libboost_serialization-vc141-mt-s-x64;libboost_serialization-vc141-mt-s;libboost_serialization-vc140-mt-s-x64-1_74;libboost_serialization-vc140-mt-s-x64;libboost_serialization-vc140-mt-s;libboost_serialization-mt-s-x64-1_74;libboost_serialization-mt-s-x64;libboost_serialization-mt-s;libboost_serialization-mt;libboost_serialization
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for SERIALIZATION_LIBRARY_DEBUG: libboost_serialization-vc142-mt-sgd-x64-1_74;libboost_serialization-vc142-mt-sgd-x64;libboost_serialization-vc142-mt-sgd;libboost_serialization-vc141-mt-sgd-x64-1_74;libboost_serialization-vc141-mt-sgd-x64;libboost_serialization-vc141-mt-sgd;libboost_serialization-vc140-mt-sgd-x64-1_74;libboost_serialization-vc140-mt-sgd-x64;libboost_serialization-vc140-mt-sgd;libboost_serialization-mt-sgd-x64-1_74;libboost_serialization-mt-sgd-x64;libboost_serialization-mt-sgd;libboost_serialization-mt;libboost_serialization
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: libboost_program_options-vc142-mt-s-x64-1_74;libboost_program_options-vc142-mt-s-x64;libboost_program_options-vc142-mt-s;libboost_program_options-vc141-mt-s-x64-1_74;libboost_program_options-vc141-mt-s-x64;libboost_program_options-vc141-mt-s;libboost_program_options-vc140-mt-s-x64-1_74;libboost_program_options-vc140-mt-s-x64;libboost_program_options-vc140-mt-s;libboost_program_options-mt-s-x64-1_74;libboost_program_options-mt-s-x64;libboost_program_options-mt-s;libboost_program_options-mt;libboost_program_options
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: libboost_program_options-vc142-mt-sgd-x64-1_74;libboost_program_options-vc142-mt-sgd-x64;libboost_program_options-vc142-mt-sgd;libboost_program_options-vc141-mt-sgd-x64-1_74;libboost_program_options-vc141-mt-sgd-x64;libboost_program_options-vc141-mt-sgd;libboost_program_options-vc140-mt-sgd-x64-1_74;libboost_program_options-vc140-mt-sgd-x64;libboost_program_options-vc140-mt-sgd;libboost_program_options-mt-sgd-x64-1_74;libboost_program_options-mt-sgd-x64;libboost_program_options-mt-sgd;libboost_program_options-mt;libboost_program_options
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2255 ] Searching for ATOMIC_LIBRARY_RELEASE: libboost_atomic-vc142-mt-s-x64-1_74;libboost_atomic-vc142-mt-s-x64;libboost_atomic-vc142-mt-s;libboost_atomic-vc141-mt-s-x64-1_74;libboost_atomic-vc141-mt-s-x64;libboost_atomic-vc141-mt-s;libboost_atomic-vc140-mt-s-x64-1_74;libboost_atomic-vc140-mt-s-x64;libboost_atomic-vc140-mt-s;libboost_atomic-mt-s-x64-1_74;libboost_atomic-mt-s-x64;libboost_atomic-mt-s;libboost_atomic-mt;libboost_atomic
-- [ C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2310 ] Searching for ATOMIC_LIBRARY_DEBUG: libboost_atomic-vc142-mt-sgd-x64-1_74;libboost_atomic-vc142-mt-sgd-x64;libboost_atomic-vc142-mt-sgd;libboost_atomic-vc141-mt-sgd-x64-1_74;libboost_atomic-vc141-mt-sgd-x64;libboost_atomic-vc141-mt-sgd;libboost_atomic-vc140-mt-sgd-x64-1_74;libboost_atomic-vc140-mt-sgd-x64;libboost_atomic-vc140-mt-sgd;libboost_atomic-mt-sgd-x64-1_74;libboost_atomic-mt-sgd-x64;libboost_atomic-mt-sgd;libboost_atomic-mt;libboost_atomic
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: system filesystem thread date_time chrono
regex serialization program_options) (found version "1.74.0")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
-- Configuring incomplete, errors occurred!
C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args)
See also "D:/a/kryptokrona/kryptokrona/build/CMakeFiles/CMakeOutput.log".
CMakeLists.txt:270 (find_package)
See also "D:/a/kryptokrona/kryptokrona/build/CMakeFiles/CMakeError.log".
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj
Error: Process completed with exit code 1.

Building a Fortran Project using CMake in PowerShell

I'm writing a PowerShell script that is supposed to use CMake to create a Ninja Build for a Fortran project:
Set-PSDebug -Trace 1
#MOVE TO load_modules
$env:CC="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018.1.156/windows/bin/intel64/icl.exe"
$env:CXX="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018.1.156/windows/bin/intel64/icl.exe"
#$env:FC="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018.1.156/windows/bin/intel64/ifort.exe"
$env:Path+=";C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\Hostx86\x86\"
$env:Path+=";C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\Hostx64\x64\"
$env:Path+=";C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\"
$env:Path+=";C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.1.156\windows\bin\intel64\"
#$env:Path+=";C:\Windows\System32\kernel32.dll"
& 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\vsdevcmd'
$env:Path+=";C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\SDK\lib\kernel32.Lib"
echo $env:Path
# Install
mkdir build
mkdir install
pushd build
Start-Process $env:CMAKE -ArgumentList "-G ""Ninja""
-DCMAKE_Fortran_COMPILER=""C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018.1.156/windows/bin/intel64/ifort.exe""
-DCMAKE_INSTALL_PREFIX=../install ../src" -NoNewWindow
However, CMake cannot sucessfully compile a C test program because 'kernel32.lib' cannot be found:
...
PS C:\Users\fnick\modflow> -- The C compiler identification is Intel
18.0.1.20171018
-- The CXX compiler identification is Intel 18.0.1.20171018
-- The Fortran compiler identification is unknown
-- Check for working C compiler: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018.1.156/windows/bin/inte l64/icl.exe
-- Check for working C compiler: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018.1.156/windows/bin/inte l64/icl.exe -- broken CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018.1.156/windows/bin/intel64/icl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/fnick/modflow/build/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/fnick/ninja.exe" "cmTC_27e84"
[1/2] Building C object CMakeFiles\cmTC_27e84.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_27e84.exe
FAILED: cmTC_27e84.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_27e84.dir --manif ests -- xilink /nologo CMakeFiles\cmTC_27e84.dir\testCCompiler.c.obj /out:cmTC_27e84.exe /implib:cmTC_27e84.lib /pdb:c mTC_27e84.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib wins pool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "xilink /nologo CMakeFiles\cmTC_27e84.dir\testCCompiler.c.obj /out:cmTC_27e84.exe /implib:cmTC_ 27e84.lib /pdb:cmTC_27e84.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib g di32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMak eFiles\cmTC_27e84.dir/intermediate.manifest CMakeFiles\cmTC_27e84.dir/manifest.res" failed (exit code 1104) with the fol lowing output:
LINK : fatal error LNK1104: Datei "kernel32.lib" kann nicht ge├Àffnet werden.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:34 (project)
...
Datei "kernel32.lib" kann nicht ge├Àffnet werden.
means "File "kernel32.lib" cannot be opened". I'm assuming this means it could not be found.
Multiple things I don't get here: I thought that
& 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\vsdevcmd'
would basically set up the environment for me?!
And also, I pointed the PATH directly to the necessary library:
$env:Path+=";C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\SDK\lib\kernel32.Lib"
but that didn't help (I tried without the explicit kernel32.Lib - didn't help; and why is there a capital 'L'?!)
From what I read, it looks like the Linux environment variables PATH and LD_LIBRARY_PATH both correspond to PATH on Windows?!
What am I missing here? What's the best way to set up a working build environment in PowerShell?
EDIT:
Calling
& 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\bin\compilervars.bat' intel64
Also doesn't help.
EDIT2:
Windows Version is "Windows Server 2012 R2 Standard" 64bit
Compilers: Intel Compilers 2018 Update 1
CMake version 3.10-rc3
Update:
A colleague gave me the following script:
function StartVSNativeCommandPromt($VSVersion, $VSName, $ArchName, $VSKind, $Options)
{
if(($VSVersion -Eq "12.0") -Or ($VSVersion -Eq "14.0"))
{
$dir = "c:\Program Files (x86)\Microsoft Visual Studio $VSVersion\VC"
}
else
{
$dir = "C:\Program Files (x86)\Microsoft Visual Studio\$VSName\$VSKind\VC\Auxiliary\Build"
}
pushd $dir
cmd.exe /c "vcvarsall.bat $Options $ArchName&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio $VSName Command Prompt variables set." -ForegroundColor Yellow
}
function StartIntelNativeCommandPromt($IntelVersion, $Arch, $VSVersion)
{
Invoke-BatchFile "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_$IntelVersion\windows\bin\compilervars.bat" $Arch $VSVersion
}
function StartVS12x64NativeCommandPromt { StartVSNativeCommandPromt "12.0" "2013" "amd64"}
function StartVS12x86NativeCommandPromt { StartVSNativeCommandPromt "12.0" "2013" "x86"}
function StartVS14x64NativeCommandPromt { StartVSNativeCommandPromt "14.0" "2015" "amd64"}
function StartVS14x86NativeCommandPromt { StartVSNativeCommandPromt "14.0" "2015" "x86"}
function StartVS15x64NativeCommandPromt { StartVSNativeCommandPromt "15.0" "2017" "amd64" "Professional"}
function StartVS15x86NativeCommandPromt { StartVSNativeCommandPromt "15.0" "2017" "x86" "Professional"}
function StartVS15x64140NativeCommandPromt { StartVSNativeCommandPromt "15.0" "2017" "amd64" "Professional" "-vcvars_ver=14.0"}
function StartVS15x86140NativeCommandPromt { StartVSNativeCommandPromt "15.0" "2017" "x86" "Professional" "-vcvars_ver=14.0"}
function StartIntel17VS15x64NativeCommandPromt {
if (-not (Test-Path env:VS2017INSTALLDIR)) { $env:VS2017INSTALLDIR = $env:VSINSTALLDIR }
StartIntelNativeCommandPromt "2017.5.267" "intel64" "vs2017"
}
function StartIntel18VS15x64NativeCommandPromt {
if (-not (Test-Path env:VS2017INSTALLDIR)) { $env:VS2017INSTALLDIR = $env:VSINSTALLDIR }
StartIntelNativeCommandPromt "2018.1.156" "intel64" "vs2017"
}
Set-Alias vs12x64 StartVS12x64NativeCommandPromt
Set-Alias vs12x86 StartVS12x86NativeCommandPromt
Set-Alias vs14x64 StartVS14x64NativeCommandPromt
Set-Alias vs14x86 StartVS14x86NativeCommandPromt
Set-Alias vs15x64 StartVS15x64NativeCommandPromt
Set-Alias vs15x86 StartVS15x86NativeCommandPromt
Set-Alias vs15x64v14 StartVS15x64140NativeCommandPromt
Set-Alias vs15x86v14 StartVS15x86140NativeCommandPromt
Set-Alias intel17x64vs15 StartIntel17VS15x64NativeCommandPromt
Set-Alias intel18x64vs15 StartIntel18VS15x64NativeCommandPromt
which allows him to set up a working environment in PowerShell by calling "vs15x64". If I include that in my script, kernel32.lib is found, however then in the same step, libmmdd.lib isn't found. So the journey continues...

CMake cannot find Boost libarary

I'm new to Cmake. I read posts of the same problem but I still cannot solve my problem. Sorry about the same question.
My boost include is in: /usr/local/Cellar/boost/1.58.0/include
My boost lib is in: /usr/local/Cellar/boost/1.58.0/lib
My CMakeLists.txt is:
cmake_minimum_required(VERSION 2.6)
SET(BOOST_ROOT /usr/local/Cellar/boost/1.58.0)
SET(BOOST_INCLUDEDIR /usr/local/Cellar/boost/1.58.0/include)
SET(BOOST_LIBRARYDIR /usr/local/Cellar/boost/1.58.0/lib)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost COMPONENTS optional REQUIRED)
include_directories(${Boost_INCLUDEDIR})
target_link_libraries(hash ${Boost_LIBRARYDIR})
The debug message I got is:
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:551 ] _boost_TEST_VERSIONS = 1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:553 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:555 ] Boost_USE_STATIC_LIBS = ON
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:557 ] Boost_USE_STATIC_RUNTIME =
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:559 ] Boost_ADDITIONAL_VERSIONS =
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:561 ] Boost_NO_SYSTEM_PATHS =
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:613 ] Declared as CMake or Environmental Variables:
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:615 ] BOOST_ROOT = /usr/local/Cellar/boost/1.58.0
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:617 ] BOOST_INCLUDEDIR = /usr/local/Cellar/boost/1.58.0/include
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:619 ] BOOST_LIBRARYDIR = /usr/local/Cellar/boost/1.58.0/lib
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:621 ] _boost_TEST_VERSIONS = 1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:690 ] Include debugging info:
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:692 ] _boost_INCLUDE_SEARCH_DIRS = /usr/local/Cellar/boost/1.58.0/include;/usr/local/Cellar/boost/1.58.0/include;/usr/local/Cellar/boost/1.58.0;PATHS;C:/boost/include;C:/boost;/sw/local/include
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:694 ] _boost_PATH_SUFFIXES = boost-1_59_0;boost_1_59_0;boost/boost-1_59_0;boost/boost_1_59_0;boost-1_59;boost_1_59;boost/boost-1_59;boost/boost_1_59;boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;boost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boost-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_46_1;boost_1_46_1;boost/boost-1_46_1;boost/boost_1_46_1;boost-1_46_0;boost_1_46_0;boost/boost-1_46_0;boost/boost_1_46_0;boost-1_46;boost_1_46;boost/boost-1_46;boost/boost_1_46;boost-1_45_0;boost_1_45_0;boost/boost-1_45_0;boost/boost_1_45_0;boost-1_45;boost_1_45;boost/boost-1_45;boost/boost_1_45;boost-1_44_0;boost_1_44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_43_0;boost_1_43_0;boost/boost-1_43_0;boost/boost_1_43_0;boost-1_43;boost_1_43;boost/boost-1_43;boost/boost_1_43;boost-1_42_0;boost_1_42_0;boost/boost-1_42_0;boost/boost_1_42_0;boost-1_42;boost_1_42;boost/boost-1_42;boost/boost_1_42;boost-1_41_0;boost_1_41_0;boost/boost-1_41_0;boost/boost_1_41_0;boost-1_41;boost_1_41;boost/boost-1_41;boost/boost_1_41;boost-1_40_0;boost_1_40_0;boost/boost-1_40_0;boost/boost_1_40_0;boost-1_40;boost_1_40;boost/boost-1_40;boost/boost_1_40;boost-1_39_0;boost_1_39_0;boost/boost-1_39_0;boost/boost_1_39_0;boost-1_39;boost_1_39;boost/boost-1_39;boost/boost_1_39;boost-1_38_0;boost_1_38_0;boost/boost-1_38_0;boost/boost_1_38_0;boost-1_38;boost_1_38;boost/boost-1_38;boost/boost_1_38;boost-1_37_0;boost_1_37_0;boost/boost-1_37_0;boost/boost_1_37_0;boost-1_37;boost_1_37;boost/boost-1_37;boost/boost_1_37;boost-1_36_1;boost_1_36_1;boost/boost-1_36_1;boost/boost_1_36_1;boost-1_36_0;boost_1_36_0;boost/boost-1_36_0;boost/boost_1_36_0;boost-1_36;boost_1_36;boost/boost-1_36;boost/boost_1_36;boost-1_35_1;boost_1_35_1;boost/boost-1_35_1;boost/boost_1_35_1;boost-1_35_0;boost_1_35_0;boost/boost-1_35_0;boost/boost_1_35_0;boost-1_35;boost_1_35;boost/boost-1_35;boost/boost_1_35;boost-1_34_1;boost_1_34_1;boost/boost-1_34_1;boost/boost_1_34_1;boost-1_34_0;boost_1_34_0;boost/boost-1_34_0;boost/boost_1_34_0;boost-1_34;boost_1_34;boost/boost-1_34;boost/boost_1_34;boost-1_33_1;boost_1_33_1;boost/boost-1_33_1;boost/boost_1_33_1;boost-1_33_0;boost_1_33_0;boost/boost-1_33_0;boost/boost_1_33_0;boost-1_33;boost_1_33;boost/boost-1_33;boost/boost_1_33
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:714 ] location of version.hpp: /usr/local/Cellar/boost/1.58.0/include/boost/version.hpp
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:738 ] version.hpp reveals boost 1.58.0
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:824 ] guessed _boost_COMPILER =
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:834 ] _boost_MULTITHREADED = -mt
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:877 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:879 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:933 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/Cellar/boost/1.58.0/lib;/usr/local/Cellar/boost/1.58.0/lib;/usr/local/Cellar/boost/1.58.0/stage/lib;/usr/local/Cellar/boost/1.58.0/include/lib;/usr/local/Cellar/boost/1.58.0/include/../lib;/usr/local/Cellar/boost/1.58.0/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib_boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/Cellar/boost/1.58.0/lib;/usr/local/Cellar/boost/1.58.0/lib;/usr/local/Cellar/boost/1.58.0/stage/lib;/usr/local/Cellar/boost/1.58.0/include/lib;/usr/local/Cellar/boost/1.58.0/include/../lib;/usr/local/Cellar/boost/1.58.0/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:1045 ] Searching for OPTIONAL_LIBRARY_RELEASE: boost_optional-mt-1_58;boost_optional-mt;boost_optional-mt-1_58;boost_optional-mt;boost_optional
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:1087 ] Searching for OPTIONAL_LIBRARY_DEBUG: boost_optional-mt-d-1_58;boost_optional-mt-d;boost_optional-mt-d-1_58;boost_optional-mt-d;boost_optional-mt;boost_optional
-- [ /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:1153 ] Boost_FOUND = 1
CMake Error at /usr/local/Cellar/cmake/3.4.1/share/cmake/Modules/FindBoost.cmake:1247 (message):
Unable to find the requested Boost libraries.
Boost version: 1.58.0
Boost include path: /usr/local/Cellar/boost/1.58.0/include
Could not find the following static Boost libraries:
boost_optional
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)
CMake Warning (dev) at CMakeLists.txt:9 (target_link_libraries):
Cannot specify link libraries for target "hash" which is not built by this
project.
CMake does not support this but it used to work accidentally and is being
allowed for compatibility.
Policy CMP0016 is not set: target_link_libraries() reports error if its
only argument is not a target. Run "cmake --help-policy CMP0016" for
policy details. Use the cmake_policy command to set the policy and
suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
I execute by running cmake .
Edit. The problem has been solved. The correct CMakeLists.txt should be :
cmake_minimum_required(VERSION 2.6)
SET(BOOST_ROOT /usr/local/Cellar/boost/1.58.0)
SET(BOOST_INCLUDEDIR /usr/local/Cellar/boost/1.58.0/include)
find_package(Boost REQUIRED)
include_directories(${BOOST_INCLUDEDIR})
add_executable(myProgram main.cc)
The error occurred because Boost.Optional is a header-only file and I do not need to locate the lib for it.
Boost.Optional is a head only libraries:
see http://www.boost.org/doc/libs/1_60_0/libs/optional/doc/html/index.html
The COMPONENTS in find_package is required only for built libraries. So, you only need to write:
find_package(Boost 1.58.0 REQUIRED)
see similar link: CMake Boost 1.59.0 geometry
Well, Boost.Optional is a header-only library so it's not possible to locate its shared lib which name, according to docs, should be specified in the components argument. I guess it's the root of the problem, and you should simply search for boost itself without any component:
find_package(Boost REQUIRED)
In this case there's no additional precompiled library so target_link_libraries for Boost.Optional is not needed (but may be required for other 3rd-party libs in the project.

CMake finds boost but nmake fails to link

I am having a issue where nmake is not linking the boost library cmake is providing. I am not exactly sure why it is doing this.
cmake_minimum_required(VERSION 2.8)
project(BoostLibTest)
set(Boost_USE_STATIC_LIBS TRUE)
set(Boost_MULTITHREADED TRUE)
set(Boost_DEBUG TRUE)
find_package(Boost COMPONENTS regex)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
add_executable(Example example.cpp)
target_link_libraries(Example ${Boost_LIBRARIES})
CMake output:
-- Building for: NMake Makefiles
-- The C compiler identification is MSVC
-- The CXX compiler identification is MSVC
-- Check for CL compiler version
-- Check for CL compiler version - 1500
-- Check if this is a free VC compiler
-- Check if this is a free VC compiler - no
-- Check CL platform
-- Check CL platform - 64 bit
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:362 ] Boost not in cache
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:365 ] _boost_TEST_VERSIONS = 1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:367 ] Boost_USE_MULTITHREADED = TRUE
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:369 ] Boost_USE_STATIC_LIBS = TRUE
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:428 ] Declared as CMake or Environmental Variables:
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:430 ] BOOST_ROOT =
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:432 ] BOOST_INCLUDEDIR =
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:434 ] BOOST_LIBRARYDIR =
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:436 ] _boost_TEST_VERSIONS = 1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:485 ] Include debugging info:
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:487 ] _boost_INCLUDE_SEARCH_DIRS = C:/boost/include;C:/boost;C:\Program Files (x86)/boost/include;C:\Program Files (x86)/boost;/sw/local/include
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:489 ] _boost_PATH_SUFFIXES = boost-1_40_0;boost_1_40_0;boost-1_40;boost_1_40;boost-1_39_0;boost_1_39_0;boost-1_39;boost_1_39;boost-1_38_0;boost_1_38_0;boost-1_38;boost_1_38;boost-1_37_0;boost_1_37_0;boost-1_37;boost_1_37;boost-1_36_1;boost_1_36_1;boost-1_36_0;boost_1_36_0;boost-1_36;boost_1_36;boost-1_35_1;boost_1_35_1;boost-1_35_0;boost_1_35_0;boost-1_35;boost_1_35;boost-1_34_1;boost_1_34_1;boost-1_34_0;boost_1_34_0;boost-1_34;boost_1_34;boost-1_33_1;boost_1_33_1;boost-1_33_0;boost_1_33_0;boost-1_33;boost_1_33
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:513 ] location of version.hpp: C:/Program Files (x86)/boost/boost_1_40/boost/version.hpp
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:532 ] version.hpp reveals boost 1.40.0
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:623 ] guessed _boost_COMPILER = -vc90
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:633 ] _boost_MULTITHREADED = -mt
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:650 ] _boost_STATIC_TAG = -s
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:652 ] _boost_ABI_TAG = gd
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:685 ] _boost_LIBRARIES_SEARCH_DIRS = C:/Program Files (x86)/boost/boost_1_40/lib;C:/Program Files (x86)/boost/boost_1_40/../lib;C:/boost/lib;C:/boost;C:\Program Files (x86)/boost/boost_1_40_0/lib;C:\Program Files (x86)/boost/boost_1_40/lib;C:\Program Files (x86)/boost/lib;C:\Program Files (x86)/boost;/sw/local/lib
-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:814 ] Boost_FOUND = TRUE
-- Boost version: 1.40.0
-- Found the following Boost libraries:
-- regex
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/blewisjr/Documents/BoostLibTest/bin
NMake output:
Scanning dependencies of target Example
[100%] Building CXX object CMakeFiles/Example.dir/example.cpp.obj
example.cpp
Linking CXX executable Example.exe
example.cpp.obj : error LNK2019: unresolved external symbol "private: class boost::basic_regex > > & __cdecl boost::basic_regex > >::do_assign(char const *,char const *,unsigned int)" (?do_assign#?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###boost##AEAAAEAV12#PEBD0I#Z) referenced in function "public: class boost::basic_regex > > & __cdecl boost::basic_regex > >::assign(char const *,char const *,unsigned int)" (?assign#?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###boost##QEAAAEAV12#PEBD0I#Z)
example.cpp.obj : error LNK2019: unresolved external symbol "public: bool __cdecl boost::re_detail::perl_matcher,class std::allocator >,class std::allocator,class std::allocator > > >,struct boost::regex_traits > >::match(void)" (?match#?$perl_matcher#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#U?$sub_match#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std###boost###2#U?$regex_traits#DV?$w32_regex_traits#D#boost###boost###re_detail#boost##QEAA_NXZ) referenced in function "bool __cdecl boost::regex_match,class std::allocator >,class std::allocator,class std::allocator > > >,char,struct boost::regex_traits > >(class std::_String_const_iterator,class std::allocator >,class std::_String_const_iterator,class std::allocator >,class boost::match_results,class std::allocator >,class std::allocator,class std::allocator > > > > &,class boost::basic_regex > > const &,enum boost::regex_constants::_match_flags)" (??$regex_match#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#U?$sub_match#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std###boost###2#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###boost##YA_NV?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##0AEAV?$match_results#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#U?$sub_match#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std###boost###2##0#AEBV?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###0#W4_match_flags#regex_constants#0##Z)
example.cpp.obj : error LNK2019: unresolved external symbol "private: void __cdecl boost::re_detail::perl_matcher,class std::allocator >,class std::allocator,class std::allocator > > >,struct boost::regex_traits > >::construct_init(class boost::basic_regex > > const &,enum boost::regex_constants::_match_flags)" (?construct_init#?$perl_matcher#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#U?$sub_match#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std###boost###2#U?$regex_traits#DV?$w32_regex_traits#D#boost###boost###re_detail#boost##AEAAXAEBV?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###3#W4_match_flags#regex_constants#3##Z) referenced in function "public: __cdecl boost::re_detail::perl_matcher,class std::allocator >,class std::allocator,class std::allocator > > >,struct boost::regex_traits > >::perl_matcher,class std::allocator >,class std::allocator,class std::allocator > > >,struct boost::regex_traits > >(class std::_String_const_iterator,class std::allocator >,class std::_String_const_iterator,class std::allocator >,class boost::match_results,class std::allocator >,class std::allocator,class std::allocator > > > > &,class boost::basic_regex > > const &,enum boost::regex_constants::_match_flags,class std::_String_const_iterator,class std::allocator >)" (??0?$perl_matcher#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#U?$sub_match#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std###boost###2#U?$regex_traits#DV?$w32_regex_traits#D#boost###boost###re_detail#boost##QEAA#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##0AEAV?$match_results#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#U?$sub_match#V?$_String_const_iterator#DU?$char_traits#D#std##V?$allocator#D#2##std###boost###2##2#AEBV?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###2#W4_match_flags#regex_constants#2#0#Z)
Example.exe : fatal error LNK1120: 3 unresolved externals
LINK Pass 1 failed. with 2
After the failed link NMake is throwing fatal error U1077
Turns out I was targeting x64 with boost libs only built for x86 issues solved by switching compiler to x86

Resources