Unable to build MySQL++ library - c++

I'm trying to build MySQL++ libraries via Visual Studio 2013 (MSVC-12.0). I've downloaded "mysql++-3.2.1.tar.gz" and unpack it. Then I added "mysql-connector-c-6.1.3-win32\include\" path to the include paths and "mysql-connector-c-6.1.3-win32\lib\" path to the libraries paths for the mysqlpp project in the mysql++ solution and tried to build it:
error LNK2001: unresolved external symbol mysql_thread_init
error LNK2001: unresolved external symbol mysql_num_rows
error LNK2001: unresolved external symbol mysql_num_fields
etc
What else should I link to this project? How can I solve it?

Those symbols are from the mysql client library, which is not included in mysql++.
Configuration Properties -> Linker -> Input -> Additional Dependencies needs libmysql.lib

I guess you used x64,but lib is win32

Related

Building a cpp project that involves IPP on MSBuild

I am rather new to cpp and ipp library, I had created a cpp.sln project which uses Intel IPP (Single-threaded Static Library) and I also able to build the project on Visual Studio.
However now I need to export the project directory to a separate computer and build it there using MSBuild. I am not too sure how do I configure the MSBuild such that it will access the IPP Static library and build the project, can anyone advise on this? Or is there any other files that I need to copy to the separate computer (I had already copy the all the ipp include header files and lib files along with my project files)
Currently when I am trying to build the project on this separate computer (with no IPP installed), I received the following error message
error LNK2019: unresolved external symbol ippFree referenced in function.....
error LNK2019: unresolved external symbol ippsMalloc_64_L referenced in function.....
error LNK2019: unresolved external symbol ippsMalloc_8u referenced in function.....
error LNK2019: unresolved external symbol ippsZero_64f referenced in function.....

GLFW not working in Visual Studio Community

I am using Visual Studio for C++. I have tried to link GLFW in Visual Studio. The steps I went through are as follows:
Specify include directories under VC++ properties.
Specify the library directories under VC++ properties.
Add the .lib file in additional dependencies under Linker -> Input
Visual Studio recognises the header #include <GLFW/glfw3.h> and recognised glfwInit() but when glfwInit() is called it causes the build to fail. I get this build error:
LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
I then also get some unresolved externals:
LNK2019 unresolved external symbol __imp__vsnprintf referenced in function __glfwInputError
LNK2001 unresolved external symbol __imp__vsnprintf
LNK2019 unresolved external symbol __imp__sscanf referenced in function _parseVersionString
LNK2001 unresolved external symbol __imp___vsnprintf
LNK1120 3 unresolved externals
Sneaky... when I downloaded GLFW it had multiple lib folders (for the different releases) and only one include folder. I assumed that the include folder would work for all of the lib folders because there was only one. However that was not the case, the include folder only worked for the latest lib folder and I tried to use the 2013 GLFW instead of the latest 2015 GLFW lib folder with the include folder to no avail. I was using 2013 GLFW because that was the version the tutorial series I was watching used if you were wondering.

Visual Studio 15 __imp___iob, __imp___pctype, __imp___mb_cur_max

I am trying to use a library compiled with mingw in visual studio. However, I get the following linker errors:
error LNK2001: unresolved external symbol __imp___iob
error LNK2019: unresolved external symbol __imp___pctype referenced in function
error LNK2019: unresolved external symbol __imp____mb_cur_max referenced in function
error LNK2001: unresolved external symbol _fprintf
I was able to fix the _fprintf error by linking against legacy_stdio_definitions.lib as per this post : unresolved external symbol __imp__fprintf and __imp____iob_func, SDL2.
However, I have no idea how to fix the other three unresolved externals. How can I fix this? The libraries work perfectly under Visual Studio 2013.
Edit:
Okay here is an update. I moved libmsvcrt.a from the mingw lib folder into Visual Studio, and I added that to the linker settings. Now it seems to work correctly.
The libraries were compiled against an old version of the CRT. The unresolved symbols you get are internal symbols of the CRT that are present in the compiled library. You have to recompile the library against the VS2015 CRT (the Universal CRT). But I'm not sure if MinGW supports this.
If you can't do that, you have to continue to use the VS2013 compiler. (You can use the VS2015 IDE, by setting the toolset to vs2013 in the project options. But you'll still be limited to the C++ features the 2013 compiler supports.)
I encountered the same problem (library compiled with static CRT instead of CRT in DLL) and I managed to make it work by changing the two following parameters in Project Properties:
Linker > Input > Ignore specific default libraries: libc.lib
C/C++ > Code Generation > Runtime Library: Multi-threaded Debug (/MTd)
If that's not enough, there's more at following page: https://social.msdn.microsoft.com/Forums/en-US/841e5723-bce4-4340-b7b3-027dcdf90f00/

Kinect + Visual Studio 2013 LNK errors, how to properly link the library?

I downloaded kinect sdk both 1.8, and 2.0. I then created a new project, and edited its properties via C/C++ and included x86 headers folders
I also edited its Linker and added its corresponding x86 libraries folder.
Yet I still get linking errors, and it's not clear to me what it may be.
error LNK2019: unresolved external symbol __imp__NuiInitialize#4 referenced in function _wmain
error LNK1120: 1 unresolved externals
Any idea? Not sure what else I can do in the linker settings.
Problem resolved,
In addition to
C/C++ include
Linker library
You also need to edit
Linker Input
In here you add Kinect10.lib (or Kinect20.lib, depending on what version you're using)

Setting up visual studio c++ 2008 with mysql c api

I'm wondering if anyone can help me on getting my visual studio c++ project setup correctly to work with MySql?
I downloaded and installed MySql Server, and installed the developer content with the include files, but beyond that I'm a bit lost.
I tried adding the 'include' directory in my MySql install path to my additional includes directory, which allowed me to access the includes I needed, but left me with unresolved external symbol errors.
1>Main.obj : error LNK2019: unresolved external symbol _mysql_error#4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _mysql_real_connect#32 referenced in function _main
Any help would be greatly appreciated.
Sounds like the library isn't being included. The first thing I would look at is Additional Dependencies. You can either set it programatically or in Visual Studio (Solution->Properities->Configuration Properties-> Linker
You may need to include the library under "additional library directories" in that same area.