Unresolved external symbol for MySQL C++ VS 2019 - c++

I'm trying to use the mysql.h library to connect to my database using c++. I included the library in the additional libraries proprierty, however, when I'm trying to run the program, I get the following error:
Error LNK2019 unresolved external symbol _mysql_init#4 referenced in function "private: static bool __cdecl AlarmHandler::pushAlarmToActiveAlarmDB(class std::shared_ptr)" (?pushAlarmToActiveAlarmDB#AlarmHandler##CA_NV?$shared_ptr#VAlarm###std###Z) Proiect Colectiv C:\Users\docto\source\repos\Proiect Colectiv\Proiect Colectiv\AlarmHandler.obj 1
For some reason, it might not be building the included library? If so, how can I fix that? Thanks!

Related

Unresolved External Error - How to know what libraries are mising ? VS2013

How do I know what libraries are required when I get such errors ? Is there a strategy on to determine the library I need given the error ? Note that this is a library problem Below is just one of the 90+ unresolved errors.
Error 74 error LNK2001: unresolved external symbol "public: virtual bool __cdecl pcl::search::Search<struct pcl::PointXYZRGB>::getSortedResults(void)" (?getSortedResults#?$Search#UPointXYZRGB#pcl###search#pcl##UEAA_NXZ) c:\Users\Haziq\documents\visual studio 2013\Projects\PCL-Tutorial\PCL-Tutorial\main.obj PCL-Tutorial
Yes, you can write code to check all installed .a and .so libraries on the system, generating the symbol table for each one, and GREPping the output for the symbol(s) that remain undefined.

Including Lua in VS2015 C++ Project

I would like to integrate Lua into my current C++ application I build with VisualStudio 2015 (x64 mode).
I grabbed a simple Lua wrapper from here, and the Lua binaries for windows x64 from here (the lua-5.1.5_Win32_dll14_lib.zip one).
Next, I added the include and library path to the project preferences. Works so far in the IDE. However, when I try to compile the code it throws 24 errors (like these first two):
1>LuaScript.obj : error LNK2019: unresolved external symbol "lua_close" referenced in function ""public: __cdecl LuaScript::~LuaScript(void)" (??1LuaScript##QEAA#XZ)".
1>LuaScript.obj : error LNK2019: unresolved external symbol "lua_gettop" referenced in function ""public: void __cdecl LuaScript::clean(void)" (?clean#LuaScript##QEAAXXZ)".
which tells me next to nothing. Seems that the linker is unable to find the library but the includes are working and the path to library is set, too. Any suggestions what I might have missed or should look into? Any hint would be appreciated!

unresolved external symbol _gluLookAt#72 referenced in function

I'm making a program using the glu library but when i compile i got this error:
1>opengl_3.obj : error LNK2019: unresolved external symbol _gluLookAt#72 referenced in function "public: void __thiscall OpenGLContext::setupScene(void)" (?setupScene#OpenGLContext##QAEXXZ)
I included GL/glu.h and checked if the lib and dll were present. (they are by default)
I'm using visual studio 2012.
Any idea where this error is coming from?
You are not linking to glu. Add glu to the libraries against which your program should be linked. A more detailed description can be found here.

Migration from IBM VisualAge C++ 3.6.5 to VS 2010

We're in the process of migrating 32-bit C++ application to 64-bit application (VS 2010). This application was developed 10 years back with IBM VisualAge C++ 3.6.5 for Windows. Since IBM has stopped support of this compiler, we're facing issues while migrating it to VS 2010.
This is mostly because of some missing libraries.
Sample errors:
error LNK2019: unresolved external symbol __uopen referenced in function "int __cdecl allocate_heap_storage_(void)" (?allocate_heap_storage##YAHXZ)
error LNK2019: unresolved external symbol __ucreate referenced in function "int __cdecl allocate_heap_storage_(void)" (?allocate_heap_storage##YAHXZ)
error LNK2019: unresolved external symbol __udestory referenced in function "int __cdecl deallocate_heap_storage_(void)" (?deallocate_heap_storage##YAHXXZ)
error LNK2019: unresolved external symbol __uclose referenced in function "int __cdecl deallocate_heap_storage_(void)" (?deallocate_heap_storage##YAHXXZ)
error LNK2019: unresolved external symbol __umalloc referenced in function "int __cdecl alloc_share_mem_(int,int)" (?alloc_share_mem#YAPAXHH#Z)
The above functions are defined in umalloc.h but we are missing the definitions.
How can we resolve this?
For the errors above, these function "_ucreate",_udestory , _uclose,_umalloc" are not found when linking, I think these functions were in the run time libraries provided by Visual Age. if you can find the lib files of the these run time libraries, you can put them in the input of link, it may pass the compiling phase, but may fail to launch.
One suggestion here is to replace the functions above with windows functions. All the functions above are related with memory allocations.

Linking Lua with Visual Studio 2010

We use Lua (www.lua.org) script to let users to customize our server software written in C++.
At the moment we are porting the 32 bits Windows version of our project to Visual Studio 2010.
Once everything works fine with VS 2008, we thought that we would have no problem on upgrade process.
Unfortunately whenever we tried to link the lualib (as dll) to our project in VS 2010, the lua functions could not be found by the linker (the error messages are displayed below).
It seems that some calling convention is wrong on 2010, like the application may be looking for the lua functions with a prefix '_'.
To access lua functions (written in C) from our project modules (C++) we use this:
extern "C" {
#include "lua/src/lua.h"
#include "lua/src/lualib.h"
#include "lua/src/lauxlib.h"
}
The same project compiles and links with lualib successfully on VS 2008 and Linux (g++).
Could anybody help me with this ?
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__luaL_openlibs referenced in function "public: int __thiscall DsCScriptEngine::Init(void)" (?Init#DsCScriptEngine##QAEHXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__luaL_newstate referenced in function "public: int __thiscall DsCScriptEngine::Init(void)" (?Init#DsCScriptEngine##QAEHXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_close referenced in function "public: void __thiscall DsCScriptEngine::Shutdown(void)" (?Shutdown#DsCScriptEngine##QAEXXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pcall referenced in function "public: long __thiscall DsCScriptEngine::Execute(char const *)" (?Execute#DsCScriptEngine##QAEJPBD#Z)
etc.
The reported missing names are correct, this not a compile problem. You must be linking the wrong .lib. The name you use sounds wrong, it isn't "lualib", the current version of the import library is named lua5.1.lib (or lua51.lib, not sure what the difference is). Download it from here.