Using GSL library 2.4 on Visual Studio 2017 and getting these errors on compile and run,
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol ___iob_func referenced in function _gsl_error
ImplementerGSL C:\Users\MyUserName\source\repos\ImplementerGSL\ImplementerGSL\gsl.lib(error.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol ___iob_func ImplementerGSL
C:\Users\MyUserName\source\repos\ImplementerGSL\ImplementerGSL\gsl.lib(stream.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _fprintf referenced in function _gsl_error ImplementerGSL
C:\Users\MyUserName\source\repos\ImplementerGSL\ImplementerGSL\gsl.lib(error.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol _fprintf ImplementerGSL
C:\Users\iTzEinstein118Xx\source\repos\ImplementerGSL\ImplementerGSL\gsl.lib(stream.obj) 1
Further details about machine and project;
- Visual Studios 2017 latest update on Fall Creators Update
- Coding in C (not C++)
- GSL is GNU Scientific Library, not to be confused with GSL.Microsoft
- Latest version of GSL library installed at C:/gsl. Known to be compatible with VS2017
- Solution properties has been edited to point to GSL libs, Additional* include directories: C:\gsl\include Additional library directories: C:\gsl\lib Additional dependancies : gsl.lib;cblas.lib Preprocessor definitions : _GSL_DLL
My goal eventually is to be using the library for another project. However, I can't get this simple test code to work. The code is written in C, VS2017 has the C++ libraries installed and so forth. Source files have been renamed to .c rather than .cpp.
My code:
#include "stdafx.h"
#include <stdlib.h>
#include <gsl/gsl_sf_bessel.h>
int main()
{
double x, y;
x = 5.0;
y = gsl_sf_bessel_zero_J0(x);
printf("J0(%g) = %.18e\n", x, y);
return 0;
}
and then my stdafx header file,
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
I have done a fair bit of research now and can't seem to find anything to fix this problem specifically. Sorry if this is a duplicate answer, but if there is another question out there that does solve this problem I would love to know about it! Thanks for any help in advance. Ps. New to C but familiar with C#.
EDIT UPDATE*: added legacy library, but this still leaves unresolved external symbol __iob_func(first two errors).