gpt4 book ai didi

c++ - 连接器/C++ 编译错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 08:02:14 26 4
gpt4 key购买 nike

当我编译包含连接器/C++ header 的代码时,出现以下错误:

c:\qt\2010.03\mingw\bin../lib/gcc/mingw32/4.4.0/../../../../include/stdint.h:27: error: 'int8_t' has a previous declaration as 'typedef signed char int8_t'

c:\qt\2010.03\mingw\bin../lib/gcc/mingw32/4.4.0/../../../../include/stdint.h:31: error: 'int32_t' has a previous declaration as 'typedef int int32_t'

c:\qt\2010.03\mingw\bin../lib/gcc/mingw32/4.4.0/../../../../include/stdint.h:32: error: 'uint32_t' has a previous declaration as 'typedef unsigned int uint32_t'

从字面上看,我所做的就是:

#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h>

现在我可以进入文件并注释掉给我错误的行:

//typedef signed char int8_t;
//typedef int int32_t;
//typedef unsigned uint32_t;

它可以编译,但是当我尝试运行 mysql 代码时:

sql::Driver *driver;
driver = get_driver_instance();

我得到了这个输出

test.exe exited with code -1073741515

有什么想法吗?

最佳答案

我想做的第一件事是将有问题的代码包装在 try/catch 中,看看它是否抛出异常,您可以从中收集一些信息...

关于c++ - 连接器/C++ 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3040866/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com