相关疑难解决方法(0)

无法编译任何C++程序; 错误:未知类型名称'uint8_t'

编辑2:问题不是一个简单的印刷错误.我在下面的日志中写了一个错字,我纠正了,但问题仍然存在.

编辑:在尝试下面之后,我错误地用gcc而不是g ++运行了一次.之前使用g ++存在问题,它现在存在.

我目前正在使用MacOS High Sierra盒子.我最近把很多文件从MacBook Air移到了这台机器上,包括我认为是Xcode的所有垃圾.现在,当我尝试编译一个非常简单的C++程序时:

#include <iostream>

int main()
{
    // VAR_DEC
    int a = 4;
    // VAR_MANIP
    a = a*2;
    // VAR_PRINT
    std::cout << a << std::endl;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我得到以下荒谬的错误:

jrfarah@Josephs-MBP: [config_file_script] $ g++ test.cpp -o test
In file included from test.cpp:1:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:15:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string:470:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string_view:171:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__string:56:
In …
Run Code Online (Sandbox Code Playgroud)

c++ macos xcode homebrew

11
推荐指数
2
解决办法
4599
查看次数

Clang(LLVM) 用框架编译

我在用:

clang -ObjC -framework UIKit -o /var/compiled/c /Documents/Source/main.m

在 OS X 终端中。我也试过 UIKit.framework,但我得到

致命错误:找不到“UIKit/UIKit.h”

既。

有什么建议?

谢谢

objective-c llvm llvm-clang ios

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

c++ ×1

homebrew ×1

ios ×1

llvm ×1

llvm-clang ×1

macos ×1

objective-c ×1

xcode ×1