Probably I have done some rookie mistake that is causing me much grief. Hopefully there is sufficient detail to reveal such. If not ... I will try my best to provide additional information.
Possibly something is missing in this massive project's repository?
Rebuilt the C++ lib from scratch in PowerShell 7 (x64) >>
1) git clone --recursive
https://github.com/CoolProp/CoolProp C:\Users\17134\Documents\CoolProp_Recursive
2) cd C:\Users\17134\Documents\CoolProp_Recursive
3) mkdir -p build
4) cd build
5) cmake .. -G "Visual Studio 17 2022" -A x64 -DCOOLPROP_STATIC_LIBRARY=ON
6) cmake --build . --config Release
There were some minor build warnings that are listed last.
Compiling an example CoolProp main.cpp and making these settings changes >>
Additional Include Directories >> C:\Users\17134\Documents\CoolProp_Recursive\include;C:\Users\17134\Documents\CoolProp_Recursive\externals\fmtlib\include\fmt;%(AdditionalIncludeDirectories)
Note: The 2nd directory above was an attempt to resolve the problem.
Additional Library Directories >> C:\Users\17134\Documents\CoolProp_Recursive\build\Release;%(AdditionalLibraryDirectories)
Additional Dependencies >> CoolProp.lib;%(AdditionalDependencies)
I have tried both of the following >>
a) C++ Language Standard >> Default (ISO C++14 Standard)
b) C++ Language Standard >> ISO C++20 Standard (/std:c++20)
... Produces this error >>
C:\Users\17134\Documents\CoolProp_Recursive\include\CPstrings.h(15,14): error C1083: Cannot open include file: 'fmt/format.h': No such file or directory
Below are affected files name/line numbers before and after hacked/commenting necessary to allow compilation.
File Name >> CPstrings.h
15 # include "fmt/format.h" // For addition of the string formatting functions and macros from fmtlib
16 # include "fmt/printf.h" // For sprintf
@@@@@
Note: Line #15 comment references fmtlib and this folder >> C:\Users\17134\Documents\CoolProp_Recursive\externals\fmtlib
is populated with other folders and header files found here >> C:\Users\17134\Documents\CoolProp_Recursive\externals\fmtlib\include\fmt
I have zero experience with fmtlib; however, I did stumble around trying to figure out if a missing include header file would resolve these issues .... absolutely no success.
Recursive git missing a component?
@@@@@
84 inline std::string format(const char* format, fmt::ArgList args) {
85 return fmt::sprintf(format, args);
86 }
87 FMT_VARIADIC(std::string, format, const char*)
132 if ((pEnd - &(cs[0])) != static_cast<int>(s.size())) {
133 // Found a character that is not able to be converted to number
134 throw CoolProp::ValueError(format("Unable to convert this string to a number:%s", cs));
135 } else {
136 return val;
137 }
Hacked/Commenting To Allow Compilation >>
15 // # include "fmt/format.h" // For addition of the string formatting functions and macros from fmtlib
16 // # include "fmt/printf.h" // For sprintf
84 // inline std::string format(const char* format, fmt::ArgList args) {
85 // return fmt::sprintf(format, args);
86 // }
87 // FMT_VARIADIC(std::string, format, const char*)
134 ;// throw CoolProp::ValueError(format("Unable to convert this string to a number:%s", cs));
----------------------------------------------------------------------
File Name >> CPnumerics.h
424 throw CoolProp::ValueError(
425 format("Too small numbers: %f cannot be tested with an accepted error of %f for a machine precision of %f. ", max, D, DBL_EPSILON));
Hacked/Commenting To Allow Compilation >>
424 ;// throw CoolProp::ValueError(
425 // format("Too small numbers: %f cannot be tested with an accepted error of %f for a machine precision of %f. ", max, D, DBL_EPSILON));
----------------------------------------------------------------------
File Name >> CoolPropTools.h
98 } else {
99 throw CoolProp::ValueError(format("%s could not be matched in get_string", s.c_str()));
100 }
Hacked/Commenting To Allow Compilation >>
98 } else {
99 ;// throw CoolProp::ValueError(format("%s could not be matched in get_string", s.c_str()));
100 }
Note: The above error and hacked/commenting is repeated at lines: 107, 127, 135
As mentioned above ... here is a list of minor build warnings >>
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(3,13): warning C4005: '_CRT_SECURE_NO_WARNINGS': macro redefinition [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(3,13):
'_CRT_SECURE_NO_WARNINGS' previously declared on the command line
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(233,39): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(281,36): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(282,39): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(408,22): warning C4267: 'return': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(576,29): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(611,29): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(914,35): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
C:\Users\17134\Documents\CoolProp_Recursive\src\CoolPropLib.cpp(919,39): warning C4267: '=': conversion from 'size_t' to 'long', possible loss of data [C:\Users\17134\Documents\CoolProp_Recursive\build\CoolProp.vcxproj]
Generating Code...
miniz.c
CoolProp.vcxproj -> C:\Users\17134\Documents\CoolProp_Recursive\build\Release\CoolProp.lib
Building Custom Rule C:/Users/17134/Documents/CoolProp_Recursive/CMakeLists.txt