Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

KalvinB

libs needed for mySQL

This topic is 5899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wrote my own mySQL class that works great when I compile it from an example workspace included with the mySQL SDK but when I create my own workspace and try to compile one of two things happen. If I include mysql++.lib I get a bunch of redefinition errors. If I don't include that file I get a bunch of undefined errors. Looking at the two workspaces I'm not seeing anything obviously different about them. You can download my class and VC++ 6 Workspace here If anyone could tell me what I need to do to get it to compile that would be great. -edit- Got it working. HOW TO ADD MYSQL++ TO AN EXISTING VISUAL C++ PROJECT ---------------------------------------------------- 1) Add mysql++.lib to the project 2) Go to Project Settings, C/C++ tab, category Preprocessor, and add the directories include and mysql/include to the "Additional include directories" edit box 3) In the source files, in which you want to use MySQL++, add the line #include <mysql++> after all other included header files (especially those of MFC) 4) In every project you make with MySQL++ support, you need to use the multithreaded DLL run-time library. This can be set in Project Settings, C/C++ tab, category Code Generation, "Use run-time library" listbox. If you don't want to change your run-time library, change the run-time library in the MySQL++ project and rebuild mysql++.lib (warning: this is not recommended and may yield linker errors in your project!) ---------------------------------------------------- The download now includes the working workspace and the DLL needed to run. Now to use make it do something worthwhile... Ben IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com ] [edited by - KalvinB on July 28, 2002 9:38:36 PM]

Share this post


Link to post
Share on other sites
Advertisement
You''re using the wrong runtime library, go to:
Project -> Settings -> C/C++ -> Code Generation -> Use Runtime Library.
Set it to "Debug Multithreaded DLL" for Win32 Debug, and "Multithreaded DLL" for Win32 Release.

And remember to link mysql++.lib in as well.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!