当我像下面给出的那样编译两个.c文件时,我得到一个非常奇怪的错误。
终端编译代码
gcc -I. -o main.c matrix.c -lblas -lgfortran
错误:
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 1 has in
我对我的Makefile有个很混乱的问题
我正在使用它构建一个具有条件编译的linux和windows的单元测试可执行文件。
对于从src代码构建对象文件的规则,它遗漏了某些文件。它似乎没有一个模式,比如所有丢失的文件都来自某个特定的目录--它只是随机地将我的src文件中的一些输出出来。
我的Makefile看起来如下:
TARGET := test_glamdring2
program_NAME := $(TARGET)
#WIN32 - need to install hg on WIN32 platform for this line to work
#HGVERSION:= $(sh
我用sshfs将目标设备(Beaglebone,手臂弓)根安装到主机上的一个文件夹中,并试图使用GCC的--sysroot选项进行交叉编译。
但是存在一个问题--一些包含头文件位于目标设备上,不仅位于/usr/include文件夹,而且位于其子文件夹arm-linux-gnueabihf中。同样,也有/usr/lib/arm gnueabihf文件夹。
"Hello“示例无法编译
[gmixaz:/work] $ $CC --sysroot=/work/sysroot h.c
In file included from /work/sysroot/usr/include/stdio.h
我正在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.
我一直在尝试获取一个C文件来调用arm的Rust库中的函数。为了编译,我尝试了: cargo build --target=armv7-unknown-linux-gnueabihf
arm-linux-gnueabi-gcc main.c target/armv7-unknown-linux-gnueabihf/debug/libmyLib.a -o main 我得到了这个错误: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status 由于某些原因,为x86编译,并与常规的g