List:MySQL++« Previous MessageNext Message »
From:sa klart Date:October 8 2004 6:50pm
Subject:Re: Visual Studio .NET (7.1.3088) and mysql++ 1.7.15
View as plain text  
> > Daniel wrote:
> > Mysql++ and the examples compiled and are working like expected, but when I
> > try to create my own project the linking doesn't work correctly. 
>Warren wrote:
>This is usually a symptom of linking with a different C runtime library 
>than was used to build the MySQL and MySQL++ libraries.  Study the Code 
>Generation settings in the example projects, and match them in your own 
>If it works, I'd appreciate a report back with details I can drop into 
>the file that comes with the package.

It worked for me. Here's the report (Done with MySQL++ 1.7.17 VS .NET 7.1.3088):

Assuming MySQL is installed in c:\mysql and MySQL++ in c:\mysql++.

Fire up VS .NET, create a Blank Solution.
Add a new project; choose Empty Project (.NET) under Visual C++ Projects.
Add a .cpp file to the solution so it _knows_ it's a C/C++ solution.
Go to the solution Property Pages and make the following changes:

Under Configuration Properties::General change "Use Managed Extensions" to "No"
Under C/C++::General add to "Additional Include Directories":
c:\mysql++\sqlplusint, c:\mysql\include
Under C/C++::Code Generation change "Enable Minimal Rebuild" to "Yes (/Gm)"
Under C/C++::Code Generation change "Basic Runtime Checks" to "Both
(/RTC1, equiv. to /RTCsu)"
Under C/C++::Code Generation change "Runtime Library" to
"Multi-threaded Debug DLL (/MDd)" [change the /MTd to /MDd]
Under Linker::General change "Ignore Import Library" to "No"
Under Linker::General add to "Additional Library Directories":
Under Linker::Input add to "Additional Dependencies": libmysql.lib
wsock32.lib "C:\mysql++\lDebug\mysql++.lib" [double quotes necessary]

You must build the example solution included with the mysql++ distro
(mysql++.sln) to create .\Debug\mysql++.lib.
While I do not know that all of these changes are necessary, I do know
that if they are made, the program will compile and link.

Steve Hulet
Re: Visual Studio .NET (7.1.3088) and mysql++ 1.7.15sa klart8 Oct