Using CoolProp as a C++ library with Visual Studio 2015

313 views
Skip to first unread message

Ari

unread,
Jun 18, 2016, 7:52:03 PM6/18/16
to coolprop-users
Hi everyone,

I am trying to use CoolProp in a C++ project but I am having difficulty even running the C++ example from the documentation. I downloaded the repository from sourceforge and unpacked it in a folder in my "Program Files". Then I added this folder to the "Additional include directories" as shown in the attached picture. Then I copied and pasted the C++ example and tried to compile it. First of all, "CPState.h" does not exist in the folder that I have downloaded. It seems this file only exist in the CoolProp-museum ( so I commented it out). Now, when I want to build the project, another problem shows up:

Error LNK2019 unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl CoolProp::get_global_param_string(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?get_global_param_string@CoolProp@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z) referenced in function _main

Is there a way to use CoolProp as a C++ library? (without compiling it first)



If not, is there a simpler instruction (for a mechanical engineer :) ) to use this library?

Bests,
Ari

Ian Bell

unread,
Jun 18, 2016, 7:56:33 PM6/18/16
to coolpro...@googlegroups.com
Ari,

First message is a very important one: the compiler you build the static library with MUST be the same that you want to compile your program with.  We only provide a  few precompiled static libraries.  We figure that people that want to use static libraries can follow the CMake build instructions :)  

Have you seen this documentation: http://www.coolprop.org/coolprop/wrappers/StaticLibrary/index.html#static-library ?  Especially at the end showing usage?  If that isn't clear, please recommend how to make it more clear.

P.S. I'm a ME too :)

Best,
Ian

--
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.
Visit this group at https://groups.google.com/group/coolprop-users.
For more options, visit https://groups.google.com/d/optout.

Ari

unread,
Jun 18, 2016, 9:35:14 PM6/18/16
to coolprop-users
Thanks Ian,

I don't know why I missed that page in the instructions! I finally got it to work.
One thing I noticed was that the CoolProp.lib file is really large:

Hopefully my boss won't complain about it. 

Bests,
Ari

Ian Bell

unread,
Jun 18, 2016, 9:37:02 PM6/18/16
to coolpro...@googlegroups.com

Not a surprise at all.  Debug static libraries are always very large.

Reply all
Reply to author
Forward
0 new messages