Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LNK2019 for inline function in static library [closed]

I'm trying to use an inline function from a static lib, but I get

error LNK2019: unresolved external symbol _ippsExp_64f@12 referenced in function "double __cdecl IppExp(double const &)" (?IppExp@@YANABN@Z)

Here's my code:

IppWrapper.h (project A)

#include <ippcore.h>
#include <ipps.h>
#include <ippvm.h>

inline double IppExp(const double& a)
{
   Ipp64f y;
   IppStatus s = ippsExp_64f(&a, &y, 1);
   return y;
}

main.cpp (A.lib is added)

#include "IppWrapper.h"

int main() 
{
   double d = IppExp(2.3);
}

dumpbin /symbols also don't receive my func. What am I missing?

like image 510
alex555 Avatar asked Jul 11 '26 01:07

alex555


1 Answers

Your inline function has nothing to do with the error you get. The error is about referencing the ippsExp_64f function. You need to link your code against code containing this function. If it's not your code but an external library, add the .lib file to your linker sources.

like image 136
SomeWittyUsername Avatar answered Jul 14 '26 13:07

SomeWittyUsername



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!