c - link error in gsl_complex_mul -
i have started using gsl recenltly in huge old c project. have managed add libraries adding location in system in properties>c/c++>general>additional include directories.
in code, including following:
#include "gsl/gsl_matrix.h" #include "gsl/gsl_matrix_complex_double.h" #include "gsl/gsl_matrix_complex_float.h" #include "gsl/gsl_matrix_complex_long_double.h" #include "gsl/gsl_math.h" #include "gsl/gsl_spmatrix.h" #include "gsl/gsl_complex.h" #include "gsl/gsl_complex_math.h" #include "gsl/gsl_inline.h" #include "gsl/gsl_complex.h"
i can use functions of gsl. in fowllowing function:
void vector_complex_mul_elements(gsl_vector_complex *v1, gsl_vector_complex *v2) { gsl_complex cpx1, cpx2, cpx3; gsl_set_complex(&cpx1, 0, 0); gsl_set_complex(&cpx2, 0, 0); gsl_set_complex(&cpx3, 0, 0); if(v1->size != v2->size) { printf("error: lenght of arrays not match.\n"); return; } for(i=0; < v1->size; i++) { cpx1 = gsl_vector_complex_get(v1, i); cpx2 = gsl_vector_complex_get(v2, i); //cpx3 = gsl_complex_mul(cpx1 , cpx2); gsl_vector_complex_set(v1, i, cpx3); } }
when uncomment line:
cpx3 = gsl_complex_mul(cpx1 , cpx2);
i following errors:
error lnk2001: unresolved external symbol "_log1p".
error lnk2001: unresolved external symbol "_log1p".
error lnk2001: unresolved external symbol "_hypot".
error lnk1120: 2 unresolved external references.
i have tried writing like:
gsl_vector_complex_set(v1, i, gsl_complex_mul(cpx1 , cpx2));
then these errors:
error lnk2019: reference unresolved external symbol "_log1p" in function "_gsl_complex_logabs".
error lnk2019: reference unresolved external symbol "_hypot" in function "_gsl_complex_div".
error lnk2001: unresolved external symbol "_log1p".
error lnk1120: 2 unresolved external references.
is linking problem or way using wrong?
these (lop1p
, hypot
) functions in standard maths library. including math.h
, linking (-lm
)? per gsl documentation.
Comments
Post a Comment