我想用来自C++ Standard Base 的Linux构建我的程序。程序依赖于Boost库,用gcc 4.4版本构建。编译失败。是否可以使用LSB C++编译器构建Boost库?或者,有没有可能用一些旧的gcc版本来构建Boost库,推荐的版本是什么?我的最终目标是让我的可执行文件和第三方Boost库在大多数Linux发行版上运行。
通常,通过使用Boost库开发C++闭源应用程序,可以为Linux发行版获得更好的二进制兼容性?
我正在使用一个32位的Ubuntu系统,我的目标是为arm架构(beagleblack)编译我的C++程序。但是,我的C++程序需要libboost,这意味着我在编译时会遇到这样的错误:
/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lboost_system
-bash: /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld:: No such file or directory
在阅读了一些博客之后,我认为我必须自己为ARM
我已经开始在Ubuntu上学习C++了。我也只有几个月的时间才开始使用Linux。
为了学习目的,我试图移植一个从Javascript到C++的2D球碰撞脚本。
我正在使用simple2D绘制C++:中的绘图
我要运行以下命令:
simple2d build c-code-test.cpp
我收到以下答复:
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
/usr/bin/ld: /tmp/ccl07DBG.o: undefined reference to symbol
我最近下载了链接中提到的代码。我的GCC版本是4.1.2。在console中开始出现以下错误之前,编译过程至少进行了一个小时。
LLVM支持声明我需要使用gcc44-c++,这在我们的机器中是不可用的:
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
# yum install gcc44-c++
Loaded plugins: security
ppsd-nonprod-base
我正在Linux上用C++开发一个程序。gcc的版本是4.5.1 20100924。我想在我的程序中使用std::atomic_int。我已经包含了原子头,如下所示:
include <atomic>
当我编译这个程序时,我得到了以下错误:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c++/4.5.1/bits/atomic_base.h:87:0,
from /usr/lib/gcc/x86_64-redhat-linux/4.
我正在尝试让crosstool ng同时使用C和C++。尽管我在使用menuconfig时选择了C++,但它似乎没有被构建。gcc编译器按预期工作,但不是g++
我不确定我做错了什么,所以如果有任何帮助,我将不胜感激。
我按照这里找到的步骤操作:
$ arm-unknown-linux-gnueabi-cpp main.cpp -o test
arm-unknown-linux-gnueabi-cpp: main.cpp: C++ compiler not installed on this system
注意:在bin目录中找不到arm-unknown-linux-gnueabi-g++。我
C和C++程序不在Angstrom上编译
C Progam (board.c):
#include<stdio.h>
void main(){
printf("hello world");
}
在Angstrom终端上编译C程序
root@pldek-beagle:~/Comparison# gcc board.c -o board
/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.7.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: this linker was not c