Reputation: 41
I know many people have asked about this error and trust me I've read ALL of them and followed all the steps! But I'm still getting the unresolved external symbol error.
I'm trying to use the dll of lp_solve (a linear programming package) in my c++ code in visual studio 2012. The error message I'm getting is: Error 80 error LNK2019: unresolved external symbol _make_lp@8 referenced in function "void __cdecl my_solve(BLAH BLAH)
The function make_lp() is from the lp_solve package and I'm calling it from my_solve() in my code. This error message pops up for each solver function I call. Seems the linker just couldn't find any of the implementation of these functions.
I've done the following
What's wrong? Thanks for your help!
Upvotes: 0
Views: 1599
Reputation: 41
The problem I had was solved after realizing I downloaded the WIN64 package for lp_solve but my visual studio is using WIN32 as build platform (even though my machine is x86_64).
Upvotes: 2
Reputation: 510
Using extern "C"
may be helpful while including lp_lib.h in your .cpp as follows:
extern "C"
{
#include "lp_lib.h"
}
For more information, please check this link: http://www.geeksforgeeks.org/extern-c-in-c/
Upvotes: 0