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

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.

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.....

how to build voro++ in visual studio 2017?

I have downloaded the last version on voro++, then I have added voro++ src path to "include directories". However, this error occured:
LNK2019 unresolved external symbol "public: __thiscall voro::voronoicell_base::voronoicell_base(void)" (??0voronoicell_base#voro##QAE#XZ) referenced in function "public: __thiscall voro::voronoicell::voronoicell(void)" (??0voronoicell#voro##QAE#XZ)
How can I solve this problem?
This library is distributes as source code and uses make file based build system. You need to compile it first into static library. Note that it does not support Visual Studio out of box so to build it you'll probably need to set up your own VS project and deal with all the porting issues that may arise.

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)

Unable to build MySQL++ library

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

Unresolved external symbols in compiling 32 bit application in Windows 64

So I am trying to compile legacy app from 32 bit to 64 bit..
I re-compiled all of the libs it used and made it look into WIN SDK6.0A x64 bit for libs..
I am using:
Visual Studio Professional Edition 2008
Visual C++
dotNet Framework 3.5 SP1
Windows Server 2008R2
Windows SDK is 6.0A
Everythings finally coming up but I am getting these weird undefined symbol errors:
error LNK2019: unresolved external symbol InterlockedDecrement referenced in function ...
error LNK2019: unresolved external symbol InterlockedIncrement referenced in function ...
error LNK2019: unresolved external symbol GetModuleBaseName referenced in ...
error LNK2019: unresolved external symbol EnumProcessModules referenced in ...
error LNK2019: unresolved external symbol EnumProcesses referenced in ...
error LNK2019: unresolved external symbol GetProcessMemoryInfo referenced
The problem is these are all win stuff from SDK.
InterlockedDec and InterlockedInc are coming from kernel32.lib
GetModuleBaseName, EnumProcessModules, EnumProcesses,GetProcessMemoryInfo are in psapi.h but also kernel32.lib or psapi.lib
I checked C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64 and both libs
kernel32.lib and psapi.lib are there.
It definitely looks up the libs at right spot. I turned on /VERBOSE:LIB
and it points to the correct folder.
So I am really confused why isnt it finding them.
Any ideas???
Thanks
So I finally figured it out, kinda...
It wasnt finding psapi.lib
In Project->Linker->Additional dependencies instead of just saying psapi.lib
I gave full path to it and it worked...
not really sure why it failed to find it before but oh well...
This is very long shot (and I don't really believe this is it) but maybe the headers are not properly guarded with extern "C" for c++ compilation? Are you including system headers or just declaring the functions yourself?
Can you post your compile and link command lines, and any #def's in your code?
Does this happen if you make a simple project from scratch that only calls one of those methods?
For the record: Same problem, different solution;
I had an entry for the directory
psapi
added in the list of
Linker/General/Additional Library Directory
This resulted in the usage of the old VS2005 platform sdk psapi.lib (it only had x86, no x64 version).
After removing the entry the correct lib from the installed WinSDK x64/psapi.lib is used now.
So keep an eye out for mixings/ordering of old & new SDKs!
Obviously the full path will also work but might be a problem when you use the project on multiple machines.
In my case(migrate from VS2008 to VS2012), issue solved after adding psapi.lib in Linker->input->Additional Dependencies in VS 2012.