我的测试代码test.cpp
#include <iostream>
using namespace std;
int main(){
cout<<"hello"<<endl;
return 0;
}
当我通过g++ test.cpp编译它时,我收到以下错误:
fatal error: iostream: No such file or directory
我的环境:
#g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc
我不小心删除了包含/usr/include/c++中的所有C++头文件的文件夹。我怎样才能恢复
UPDATE我在/usr/include/c++中得到了头文件。然而,即使是一个简单的C++ Hello程序也给了我这个错误
In file included from /usr/include/c++/4.6/bits/localefwd.h:42:0,
from /usr/include/c++/4.6/ios:42,
from /usr/include/c++/4.6/ostream:40,
from /usr/in
我的Linux机器有以下定义:
RHEL 5.4
内核版本2.6.18
但是我没有g++命令。(我需要在Linux下编写c++程序)
例如:
[root@linux /etc]# g++
-bash: g++: command not found
我还尝试了以下几点:
yum install gcc
loaded plugins: security
Setting up Install Process
No package g++ available.
Nothing to do
我的问题是:如何安装/下载g++命令?从哪里可以得到g++?
我有gcc的命令,但这只是C程序,而不
我想把64 cpp应用程序变成32位Ubuntu。在编译过程中,我会收到以下错误:
In file included from /usr/include/c++/4.6/i686-linux-gnu/64/bits/os_defines.h:40:0,
from /usr/include/c++/4.6/i686-linux-gnu/64/bits/c++config.h:393,
from /usr/include/c++/4.6/string:40,
from ./util.h:4,
我正在尝试从Oracle站点在我漂亮的新AWS服务器上安装JDK7 &
sudo rpm -ivh ./jdk-7u7-linux-i586.rpm
生产的
Unpacking JAR files...
rt.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/rt.pack
jsse.jar...
Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/jsse.pack
...etc...
在Linux操作系统上编译C++代码有问题(LUbuntu 15.05)。
与我在XUbuntu 14.10、Arch和Gentoo Linux上编译的代码相同。一切都很好。现在,我在家用桌面pc上安装了LUbuntu,当我开始安装时,我会给出以下错误:
g++ -O2 -Wall -o main.o main.cpp
In file included from /usr/include/i386-linux-gnu/c++/5/bits/gthr-default.h:35:0,
from /usr/include/i386-linux-gnu/c++/5/b
我正在尝试编译一个包含<iostream>头的简单c++代码。令人惊讶的是,我正面临着我以前从未遇到过的错误。如果删除了<iostream>头,一切都会正常工作。
代码:
#include <iostream>
int main(){
return 0;
}
编译错误:
$ g++ temp.cpp
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:9:0,
from /usr/include/c++/7/cstdint:4
我正尝试在我的Ubuntu机器上本地运行Codename One,这样我就不用把构建发送到codenameone.com了。我遵循了本教程中的步骤:
并全部安装成功。当我转到我的项目目录并运行:
ant build-for-android-device-locally
我得到以下错误:
/home/petr/projects/MyApp/dist/android/src/com/codename1/social/FacebookImpl.java:37: error: package com.facebook does not exist
因此,我下载了facebook sdk,使用Grad
我尝试构建和运行c++文件,但每次尝试都失败。这是我在终端中编译它时的代码
In file included from /usr/local/include/c++/8.3.0/x86_64-cros-linux-gnu/bits/os_defines.h:39,
from /usr/local/include/c++/8.3.0/x86_64-cros-linux-gnu/bits/c++config.h:508,
from /usr/local/include/c++/8.3.0/iostream:38,
fro