CoolProp inclusion in a Frotran File within MS Visual Studio??

104 views
Skip to first unread message

Mehdi Golafshani

unread,
Aug 3, 2023, 7:03:37 AM8/3/23
to coolprop-users
Hello everyone.

Does anyone know how to link a frotran program and link it to CoolProp from within the Microsoft Visual Studio?

Thanks.
Best wishes, Mehdi...
Peace & GOD Bless 

Ian Bell

unread,
Aug 3, 2023, 8:38:03 AM8/3/23
to coolpro...@googlegroups.com
Which direction are you going? Calling Fortran from C++? If so, you would want to make the fortran project in cmake and add it as a dependent project to the CoolProp build. It's tricky to get right. Can you show a minimal example of the fortran you would like to call?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/0af41090-7049-483f-8c2a-1bee9e52333dn%40googlegroups.com.

Mehdi Golafshani

unread,
Aug 4, 2023, 11:57:19 AM8/4/23
to coolpro...@googlegroups.com
Hello. Thank you for responding. The example below is what I intend to do:

I am writing a short program in Fortran 77 inside the MS Visual Studio. The compiler is Intel Fortran. I have put both the  CoolProp dll and Cool Prop Lib in the same place as my program file location.


image.png

As you can see I get this unresolved error that says :

1>------ Build started: Project: example (IFORT), Configuration: Debug x64 ------
Linking...
Example_f77.obj : error LNK2019: unresolved external symbol PROPSSI referenced in function MAIN__
x64\Debug\example.exe : fatal error LNK1120: 1 unresolved externals

Build log written to  "file://C:/Users/A00561627/OneDrive%20-%20ONEVIRTUALOFFICE/Documents/Materials%20&%20Specifications%20&%20Standards/CRYO/Examples/example/x64/Debug/BuildLog.htm"
example - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 11:54 AM and took 00.481 seconds ==========



Best Wishes, Mehdi ... 

Peace and GOD Bless





You received this message because you are subscribed to a topic in the Google Groups "coolprop-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coolprop-users/mYbjtH1-GIo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/CAJQnXJfie3BmgGFg%2BB6Y-tH-Cj%2Bq-TLHfHzSJtvU5X7%2BEdscsg%40mail.gmail.com.

Mehdi Golafshani

unread,
Aug 4, 2023, 12:03:14 PM8/4/23
to coolpro...@googlegroups.com
image.png
Best Wishes, Mehdi ... 

Peace and GOD Bless

Mehdi Golafshani, PhD.
Chief Technologist & Engineering Manager
Design By Analysis, Inc.
984 Southford Road, Ste 9
Middlebury, CT 06762
(203) 805-4314


Mehdi Golafshani

unread,
Aug 4, 2023, 12:09:53 PM8/4/23
to coolpro...@googlegroups.com
image.png
Best Wishes, Mehdi ... 

Peace and GOD Bless



Ian Bell

unread,
Aug 6, 2023, 2:13:41 PM8/6/23
to coolpro...@googlegroups.com
Please see: http://www.coolprop.org/coolprop/wrappers/FORTRAN/index.html#fortran

You will have to make sure you add the path to the folder containing the .dll file to your project in VS

Mehdi Golafshani

unread,
Aug 7, 2023, 1:02:17 PM8/7/23
to coolprop-users
Can you be more specific.
Where to add and what to add?

Thank you.

Ian Bell

unread,
Aug 7, 2023, 7:40:25 PM8/7/23
to coolpro...@googlegroups.com
Sorry this is not CoolProp related, you need to read up on linking Fortran code with external libraries compiled into shared libraries.

Reply all
Reply to author
Forward
0 new messages