error C2371: 'int8_t' : redefinition; different basic types

I keep getting this annoying error whenever I include certain header files into the source file with the main function. Here's the compiler output...

1
2
1>c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h(17): error C2371: 'int8_t' : redefinition; different basic types
1>          c:\users\slartibartfast\documents\visual studio 2010\projects\mysql_connector_110\include\cppconn\config.h(60) : see declaration of 'int8_t'


And the source file with the main function...

1
2
3
4
5
6
7
#include "stdafx.h"
#include "Database.h" //uses cppconn header files

int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}


Any ideas?
Well, apparently both stdint.h and config.h typedef int8_t.
Can you somehow avoid including either one?
Post the includes in "Database.h"
I might not have been totally correct when I said that including "Database.h" was causing the error. I rebuilt the entire project and it turns out that "Socket.h" is the one to blame. The includes for all three header files in my project are posted below.

Socket.h
1
2
3
4
5
6
7
#ifndef SOCKET_H__
#define SOCKET_H__
#include "Parser.h"
#include "Database.h"
#include <string>
#include <iostream>
#include <boost/asio.hpp> 


Database.h
1
2
3
4
5
6
7
#ifndef DATABASE_H__
#define DATABASE_H__
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/connection.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h> 


Parser.h
1
2
3
#ifndef PARSER_H__
#define PARSER_H__
#include <regex> 


I can include both "Parser.h" and "Database.h" in the main source file without any problems, but if I include "Socket.h" and comment out the other two includes, I get the redefinition error.
Last edited on
I can't really help. It's an ugly situation.. stdint.h is included by string, iostream or boost/asio.h try finding which one it is. When you do, try looking at that file, see if there are any preprocessor conditions that could prevent including it of typedefing int8_t.
I've removed string and iostream from my header files since I didn't really need them. The conflict is between one of many header files inside boost/asio.h and cppconn/config.h.

I've googled around and saw that no one else seems to be having this problem. Other people have used mysql and boost in their projects without any collisions. I'm using VC++ with Visual Studio 2010, if that helps any. Perhaps there's something I forgot to configure?
Topic archived. No new replies allowed.