nrutil.c compile error


Giant
07-11-2005, 10:16 AM
Hi, firstly sorry if this is posted in the wrong section
but I was unsure where exactly to put it.

Anyway, trying to incorporate the svdcmd code into a program, but when I include nrutil.c and nrutil.h
(with all necessary #includes i.e. defs.h) my program falls overwith alot of warnings and 2-3 errors (depending on what I try to do), as follows:


warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
warning C4244: '=' : conversion from 'double' to 'float', ossible loss of data
warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
warning C4244: 'return' : conversion from 'double' to 'float', possible loss of data
warning C4244: 'return' : conversion from 'double' to 'float', possible loss of data
Linking...
OneChannel.obj : error LNK2019: unresolved external
symbol "void __cdecl free_vector(float *,long,long)" (?free_vector@@YAXPAMJJ@Z) referenced in function "void
__cdecl svdcmp(float * *,int,int,float * const,float * *)" (?svdcmp@@YAXPAPAMHHQAM0@Z)
OneChannel.obj : error LNK2019: unresolved external
symbol "float * __cdecl vector(long,long)" (?vector@@YAPAMJJ@Z) referenced in function "void
__cdecl svdcmp(float * *,int,int,float * const,float * *)" (?svdcmp@@YAXPAPAMHHQAM0@Z)
Debug/OneChannel.exe : fatal error LNK1120: 2 unresolved externals


Any advice would be helpful as I am unsure how to continue. I am running Microsoft Visual Studios 7, if that is any help. I believe it may be something to do with VS7 as I cannot find this problem anywhere else :S.

Thanks in advance,
Giant.

Giant
07-12-2005, 07:18 AM
For anyone having the same problem, you probably are trying to #include a .c filename, to fix the problem simply rename your nrutil.c file to nrutil.cpp and rebuld solution, this will fix the problem.

Giant.