Im creating a program in C and I am going to need some thermodynamics properties for water and steam. I have searched online and i found this library: http://freesteam.sourceforge.net
On their website they advise to compile using something called "scons". for that, i must have a file called SConstruct with the following code
# simple SCons script to build the example(s)
env = Environment()
import sys
import platform
if platform.system() == "Windows":
# windows has problems, so we help it along a bit...
cmd = [sys.executable,r'..\freesteam-config']
else:
# on other platforms, it just works...
cmd = ['freesteam-config']
env.ParseConfig(cmd + ['--libs','--cppflags'])
env.Program('test1',['test1.c'])
and run the line $ scons
on the command line.
My big problem is that when i run a simple code, this part of the code doesn't seem to run properly:
#include <freesteam/steam_ps.h>
#include <freesteam/steam_pT.h>
#include <freesteam/region4.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
t = d - (a-d)/(1 + pow((p[0]/c),b));
I just posted the libraries and the line that doesn't seem to work, since the rest is just printfs and scanfs. All those variables are doubles.
and then i get this error
ubuntu@ubuntu:~/Documents/test folder$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o test1 test1.o -L/usr/local/lib -lfreesteam
/usr/bin/ld: test1.o: undefined reference to symbol 'pow@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
scons: *** [test1] Error 1
scons: building terminated because of errors.
If anyone can help me with this, I would be grateful.
I am not entirely sure, but I think it might be the pow(
) function.
Although i have tried putting something like pow(2,2)
and it works fine.