problem when calling mysql.h

This is a discussion on problem when calling mysql.h within the C++ Programming forums, part of the General Programming Boards category; Hi! I have a prolem with include header for mysql "mysql.h". I use OS linux Ubuntu 10.04 LTS. I know ...

  1. #1
    Registered User
    Join Date
    Jan 2012
    Location
    Sevnica, Slovenija
    Posts
    1

    Exclamation problem when calling mysql.h

    Hi! I have a prolem with include header for mysql "mysql.h". I use OS linux Ubuntu 10.04 LTS. I know where are headers for database mysql. In directory
    Code:
    /usr/include/mysql/mysql.h
    my simple source in c++:
    Code:
    //example0001.cpp
    #include <iostream>
    #include <mysql>
    
    int main(){
    cout << "Hello world" << endl; return 0;
    }
    Error is:
    Code:
     skripte/primer_mysql001.cpp:3:17: error: mysql: No such file or directory
    what is wrong with such a simple example.
    Thanx for answer.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    2,902
    Your include file is "mysql.h" not "mysql" you need to add the proper extension. You may also need to specify the correct subdirectory: <mysql/mysql.h>.



    Jim

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    1,209
    Don't forget to link with the correct library or you will get other errors when trying to compile.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,918
    Btw, you are having problems including mysql.h, not calling. Proper terminology is important.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to properly return MySQL results to a calling function?
    By Effenberg0x0 in forum C Programming
    Replies: 3
    Last Post: 06-09-2011, 04:42 AM
  2. MySQL Problem
    By acbarberi in forum C Programming
    Replies: 4
    Last Post: 03-01-2010, 09:57 PM
  3. Problem with MYSQL
    By maxorator in forum C++ Programming
    Replies: 9
    Last Post: 08-25-2005, 03:33 AM
  4. linker problem with mysql
    By august_01 in forum C++ Programming
    Replies: 1
    Last Post: 04-24-2005, 12:04 PM
  5. Mysql Problem
    By gvector1 in forum C# Programming
    Replies: 1
    Last Post: 10-22-2003, 02:55 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21