Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    2

    Question Unanswered: Help using MySQL++ with Visual C++

    Hey,

    I'm trying to write a small program using Visual C++ that will read in a log file, parse it, and then use that to update a MySQL database.

    I downloaded the Visual C++ API (v 1.7.1) and started messing around with the examples that they provide and didn't have any problems making them connect to the database or run SQL statements. It generates several warnings at compile time, but these are expected according to the API's documentation.

    The problem comes when I try to '#include <fstream.h>' in order to add an 'ifstream' object to be used to read in from the log file. At this point the code ceases to compile and instead starts generating:

    error C2872: 'ostream' : ambiguous symbol

    in just about every header file related to file IO in Visual Studio's include directory as well in the headers provided with the MySQL++ API. Needless to say this has me frustrated as all I seem to be able to do with the MySQL++ API in a program is connect to a database.

    I've tried seperating the code into different files (which I never really expected to work, but hey) and have checked that I have correct libraries and dll's loaded for use with MySQL.

    I've spent the last day feeling like I'm banging my head against a wall here and asides from the relief I get when I stop it's not helping me at all. If anyone has any ideas or solutions for me please help. Even if it's just a suggestion of a different part of the wall to hit... every little bit helps. I can only hope that I'm being very stupid somewhere and that someone can send a one line fix to the problem...

    Thanks in advance,

    Matt

    mbeets@omam.com

  2. #2
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    2

    Post Additional Information

    Here is a set of files that I think better demonstrates the problem than a written description could.

    It includes the MySQL API and a helpfile showing how to set up Visual C++ in order to replicate the problem.

    I hope this can help somebody to diagnose the problem better.

    Thanks again

    Matt

    mbeets@omam.com
    Attached Files Attached Files

  3. #3
    Join Date
    Jan 2004
    Posts
    1

    Smile Re: Additional Information

    the ambiguous symbol bollics u are getting is a mess up in the using namespace std; that is done within teh mysql++ file and screws up the #include <iostream.h> and mixes with #include <iostream> which it expects, change ur iostream.h to just plain iostream and either place the <iostream> after the <mysql++> or before with a using namespace std;

    hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •