g++ -I ..\externals\cppformat example.cpp--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-users+unsubscribe@googlegroups.com.
To post to this group, send email to coolprop-users@googlegroups.com.
Visit this group at https://groups.google.com/group/coolprop-users.
For more options, visit https://groups.google.com/d/optout.
Yup, you should use the cmake build system, that will make everything work totally seamlessly: http://www.coolprop.org/coolprop/wrappers/StaticLibrary/index.html#cmake-integrationAlso, that code is for version 4, which is no longer supported. You should try this instead: http://www.coolprop.org/coolprop/LowLevelAPI.html#introduction
On Mon, Jul 9, 2018 at 2:46 AM, Pavan Padubidri <idiot...@gmail.com> wrote:
Hello,I tried to run this example code from CoolProp website and got many errors like CPState.h not found , get_global_param_string(..) not declared in the scope.I started debugging and figured out that CoolProp.h and other header files has to included while compiling the example file. So I have kept the example file in CoolProp/include and useg++ -I ..\externals\cppformat example.cppI am guessing I am not compiling the file properly. Please guide me on how to run the example file using gcc on 64bit Windows 10 or direct me to any article that tells how to use CoolProp in C++.
--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To post to this group, send email to coolpro...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-users+unsubscribe@googlegroups.com.
To post to this group, send email to coolprop-users@googlegroups.com.
[ 0%] Built target generate_headers[ 2%] Building CXX object CMakeFiles/CoolProp.dir/src/CoolProp.cpp.objE:\CoolProp\src\CoolProp.cpp:37:18: fatal error: locale: No such file or directorycompilation terminated.CMakeFiles\CoolProp.dir\build.make:132: recipe for target 'CMakeFiles/CoolProp.dir/src/CoolProp.cpp.obj' failedmingw32-make.exe[2]: *** [CMakeFiles/CoolProp.dir/src/CoolProp.cpp.obj] Error 1CMakeFiles\Makefile2:103: recipe for target 'CMakeFiles/CoolProp.dir/all' failedmingw32-make.exe[1]: *** [CMakeFiles/CoolProp.dir/all] Error 2Makefile:128: recipe for target 'all' failedmingw32-make.exe: *** [all] Error 2
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-users+unsubscribe@googlegroups.com.
To post to this group, send email to coolprop-users@googlegroups.com.
CMakeFiles\main.dir/objects.a(mycode.cpp.obj):mycode.cpp:(.text+0x4e2): undefined reference to `CoolProp::PropsSI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'collect2.exe: error: ld returned 1 exit statusmingw32-make.exe[2]: *** [CMakeFiles\main.dir\build.make:87: main.exe] Error 1mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:72: CMakeFiles/main.dir/all] Error 2mingw32-make.exe: *** [Makefile:129: all] Error 2
$ cmake --build .Scanning dependencies of target generate_headersgit version 2.17.0.windows.1cpversion.h is up to dateversion written to hidden file: E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\.version for use in builders that don't use git repogit is accessible at the command linegit revision is 514ee59e27e4414b44774bd48f8e81da73735dd7gitrevision.h is up to dateall_fluids_JSON.h is up to dateall_incompressibles_JSON.h is up to datemixture_departure_functions_JSON.h is up to datemixture_binary_pairs_JSON.h is up to datepredefined_mixtures_JSON.h is up to dateall_cubics_JSON.h is up to datecubic_fluids_schema_JSON.h is up to date[ 0%] Built target generate_headersScanning dependencies of target CoolProp[ 2%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/AbstractState.cpp.obj[ 4%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/CPfilepaths.cpp.obj[ 6%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/CPnumerics.cpp.obj[ 8%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/CPstrings.cpp.obj[ 10%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Configuration.cpp.obj[ 13%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/CoolProp.cpp.obj[ 15%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/CoolPropTools.cpp.obj[ 17%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/DataStructures.cpp.obj[ 19%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Helmholtz.cpp.obj[ 21%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/HumidAirProp.cpp.obj[ 23%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Ice.cpp.obj[ 26%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/MatrixMath.cpp.obj[ 28%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/ODEIntegrators.cpp.obj[ 30%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/PolyMath.cpp.obj[ 32%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Solvers.cpp.objE:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:114:77: warning: optimization attribute on 'double CoolProp::Newton(CoolProp::FuncWrapper1DWithDeriv*, double, double, int)' follows definition but the attribute doesn't match [-Wattributes]double Newton(FuncWrapper1DWithDeriv* f, double x0, double ftol, int maxiter)^In file included from E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:2:E:/ModeliCon_InfoTech/Project_sCO2/simple_cmake_example/externals/coolprop/include/Solvers.h:90:15: note: previous definition of 'double CoolProp::Newton(CoolProp::FuncWrapper1DWithDeriv&, double, double, int)' was hereinline double Newton(FuncWrapper1DWithDeriv &f, double x0, double ftol, int maxiter){^~~~~~E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:160:98: warning: optimization attribute on 'double CoolProp::Halley(CoolProp::FuncWrapper1DWithTwoDerivs*, double, double, int, double)' follows definition but the attribute doesn't match [-Wattributes]double Halley(FuncWrapper1DWithTwoDerivs* f, double x0, double ftol, int maxiter, double xtol_rel)^In file included from E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:2:E:/ModeliCon_InfoTech/Project_sCO2/simple_cmake_example/externals/coolprop/include/Solvers.h:93:15: note: previous definition of 'double CoolProp::Halley(CoolProp::FuncWrapper1DWithTwoDerivs&, double, double, int, double)' was hereinline double Halley(FuncWrapper1DWithTwoDerivs &f, double x0, double ftol, int maxiter, double xtol_rel = 1e-12){^~~~~~E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:222:106: warning: optimization attribute on 'double CoolProp::Householder4(CoolProp::FuncWrapper1DWithThreeDerivs*, double, double, int, double)' follows definition but the attribute doesn't match [-Wattributes]double Householder4(FuncWrapper1DWithThreeDerivs* f, double x0, double ftol, int maxiter, double xtol_rel)^In file included from E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:2:E:/ModeliCon_InfoTech/Project_sCO2/simple_cmake_example/externals/coolprop/include/Solvers.h:96:15: note: previous definition of 'double CoolProp::Householder4(CoolProp::FuncWrapper1DWithThreeDerivs&, double, double, int, double)' was hereinline double Householder4(FuncWrapper1DWithThreeDerivs &f, double x0, double ftol, int maxiter, double xtol_rel = 1e-12){^~~~~~~~~~~~E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:285:78: warning: optimization attribute on 'double CoolProp::Secant(CoolProp::FuncWrapper1D*, double, double, double, int)' follows definition but the attribute doesn't match [-Wattributes]double Secant(FuncWrapper1D* f, double x0, double dx, double tol, int maxiter)^In file included from E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:2:E:/ModeliCon_InfoTech/Project_sCO2/simple_cmake_example/externals/coolprop/include/Solvers.h:84:15: note: previous definition of 'double CoolProp::Secant(CoolProp::FuncWrapper1D&, double, double, double, int)' was hereinline double Secant(FuncWrapper1D &f, double x0, double dx, double ftol, int maxiter){^~~~~~E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:359:111: warning: optimization attribute on 'double CoolProp::BoundedSecant(CoolProp::FuncWrapper1D*, double, double, double, double, double, int)' follows definition but the attribute doesn't match [-Wattributes]double BoundedSecant(FuncWrapper1D* f, double x0, double xmin, double xmax, double dx, double tol, int maxiter)^In file included from E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:2:E:/ModeliCon_InfoTech/Project_sCO2/simple_cmake_example/externals/coolprop/include/Solvers.h:87:15: note: previous definition of 'double CoolProp::BoundedSecant(CoolProp::FuncWrapper1D&, double, double, double, double, double, int)' was hereinline double BoundedSecant(FuncWrapper1D &f, double x0, double xmin, double xmax, double dx, double ftol, int maxiter){^~~~~~~~~~~~~E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:413:89: warning: optimization attribute on 'double CoolProp::Brent(CoolProp::FuncWrapper1D*, double, double, double, double, int)' follows definition but the attribute doesn't match [-Wattributes]double Brent(FuncWrapper1D* f, double a, double b, double macheps, double t, int maxiter)^In file included from E:\ModeliCon_InfoTech\Project_sCO2\simple_cmake_example\externals\coolprop\src\Solvers.cpp:2:E:/ModeliCon_InfoTech/Project_sCO2/simple_cmake_example/externals/coolprop/include/Solvers.h:81:15: note: previous definition of 'double CoolProp::Brent(CoolProp::FuncWrapper1D&, double, double, double, double, int)' was hereinline double Brent(FuncWrapper1D &f, double a, double b, double macheps, double t, int maxiter){^~~~~[ 34%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/SpeedTest.cpp.obj[ 36%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Cubics/CubicBackend.cpp.obj[ 39%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Cubics/CubicsLibrary.cpp.obj[ 41%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Cubics/GeneralizedCubic.cpp.obj[ 43%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Cubics/UNIFAC.cpp.obj[ 45%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Cubics/UNIFACLibrary.cpp.obj[ 47%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Cubics/VTPRBackend.cpp.obj[ 50%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/IF97/IF97Backend.cpp.obj[ 52%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/FlashRoutines.cpp.obj[ 54%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/Fluids/Ancillaries.cpp.obj[ 56%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/Fluids/FluidLibrary.cpp.obj[ 58%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/HelmholtzEOSBackend.cpp.obj[ 60%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp.obj[ 63%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/MixtureDerivatives.cpp.obj[ 65%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/MixtureParameters.cpp.obj[ 67%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/PhaseEnvelopeRoutines.cpp.obj[ 69%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/ReducingFunctions.cpp.obj[ 71%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/TransportRoutines.cpp.obj[ 73%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Helmholtz/VLERoutines.cpp.obj[ 76%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/REFPROP/REFPROPBackend.cpp.obj[ 78%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/REFPROP/REFPROPMixtureBackend.cpp.obj[ 80%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Incompressible/IncompressibleBackend.cpp.obj[ 82%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Incompressible/IncompressibleFluid.cpp.obj[ 84%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Incompressible/IncompressibleLibrary.cpp.obj[ 86%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Tabular/BicubicBackend.cpp.obj[ 89%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Tabular/TTSEBackend.cpp.obj[ 91%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/Backends/Tabular/TabularBackends.cpp.obj[ 93%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/CoolPropLib.cpp.obj[ 95%] Linking CXX static library libCoolProp.a[ 95%] Built target CoolPropScanning dependencies of target main[ 97%] Building CXX object CMakeFiles/main.dir/mycode.cpp.obj[100%] Linking CXX executable main.exe