gpt4 book ai didi

mysql - 为什么即使头文件路径在包含路径中,Visual Studio Code 也找不到 `ulong/uint`?

转载 作者:行者123 更新时间:2023-11-29 02:11:49 25 4
gpt4 key购买 nike

我正在尝试使用 Ubuntu 上的 Visual Studio Code 使 Intellisense 在 MySQL 源代码上工作。

该项目需要安装libmysqlclient-dev

即使我在 includePath 中包含开发 header 路径:

        "includePath": [
"/usr/include/mysql",
"${workspaceFolder}/include"
],

(这是必需的包含的一部分;我添加了很多其他的都无济于事)

无法识别数据类型 ulonguint,导致一连串错误:

identifier "uint" is undefined
identifier "ulong" is undefined
// and so on

这很奇怪,因为我可以看到定义了两种类型:

/usr/include/mysql/my_global.h
177:typedef unsigned int uint;
497:typedef unsigned long ulong; /* Short for unsigned long */
504:typedef unsigned long long int ulonglong; /* ulong or unsigned long long */

包含指令存在(示例文件如下):

client/mysqldump.c
43:#include <my_global.h>

我错过了什么?

最佳答案

鉴于源代码中#if#ifdef#ifndef等条件编译特性的复杂使用(一个版本可用 here ),如果没有关于您的确切环境的具体信息,就不可能准确说出您需要做什么。

但是,一般来说,您需要确保您的环境是这样的,即具有相关 typedef 语句的行实际上被 C 预处理器包含在编译的代码中。

有几种方法可以帮助确定这一点。第一,你可以让你的编译器转储它所有的宏。对于 MSVC,请参阅 How to find out cl.exe's built-in macros .其次,您可以检查预处理代码的输出。对于 MSVC,请参阅 How do I see a C/C++ source file after preprocessing in Visual Studio? .

当由于复杂的 #if... 预处理器指令而导致许多可能的结果时,其中任何一个都可以极大地帮助您查看实际编译的代码。

关于mysql - 为什么即使头文件路径在包含路径中,Visual Studio Code 也找不到 `ulong/uint`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50281380/

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