在中,我想自己编译一个新的glibc。我知道编译一个glic是很困难的,所以在我的第一步中,我想编写一个新的glibc,它与我的linux系统上已经运行的版本完全相同。我可以跳过工具链依赖检查,开始专注于glic本身。
我的ubuntu信息是这样的:
abbott@abbott-VirtualBox:/software/glibc/code$ uname -a
Linux abbott-VirtualBox 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86
我现在的makefile有一些问题。我有一个cpp文件和一个h文件。我正在尝试使用c++11标准进行编译。这是我的makefile:
OBJECTS = main.o
#List all object files here separated by a space
HEADERS = main.h
#List all header files here seperated by a space
lab8: $(OBJECTS)
g++ $^ -o program3
%.o: %.cpp $(HEADERS)
g++ -std=c+
它编译,但不会从.o文件链接到可执行文件。我已经删除了从现在到它运行良好(基本上是str_to_int中的所有东西)所改变的一切。
我的代码:
#include <stdio.h>
#include <stdlib.h>
int str_to_int( char string[] ) {
// takes null-terminate ascii string, returns int value
// value of digit at i = (value*10)+(str[i]-'0').
int num=0;
int s
下面是我在Eclipse中使用的代码(来自官方boost文档):
#define BOOST_TEST_MODULE MyTest
#include <boost/test/unit_test.hpp>
int add(int i, int j) {
return i + j;
}
BOOST_AUTO_TEST_CASE( my_test ) {
// seven ways to detect and report the same error:
BOOST_CHECK(add(2, 2) == 4); // #1 continues on e
我完全编辑了这个问题。我发现了一些没有意义的东西,但它是有效的。当我第一次运行make时,我得到了以下输出:
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /u
在编译C++项目时,
我犯了个错误:
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0xc): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x11): undefined reference to `__lib
为什么当我用makefile编译我的程序时,我会得到:
gcc -Wall -pedantic src/main.c -o _wk/main.o
src/main.c:9:11: warning: C++ style comments are not allowed in ISO C90
src/main.c:9:11: warning: (this will be reported only once per input file)
src/main.c: In function ‘initialiseStructItimerval’:
src/main.c:46: warning: for
我用C语言写了一个程序,当我用gcc编译时,我得到了这些错误。直到最近我才开始使用它们,而且我的程序也没有改变。
In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.fini+0x0): first defined here
slots: In function `__data_start':
(.data+0x0): multiple definiti
我有一个共享库,由另一个我无法控制的应用程序使用,它需要*.so对象。我的库使用了需要静态链接的sqlite3 (我绝对需要一个自包含的二进制文件)。
当我试图编译和链接我的库时:
-fpic -flto -pthread -m64
-flto -static -shared
最后会出现以下错误:
/usr/bin/ld: /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when mak
当我试图使用makefile运行我的代码时,我得到了这个错误:
find_bits.o: In function `__x86.get_pc_thunk.bx':
(.text+0x30): multiple definition of `__x86.get_pc_thunk.bx'
/usr/lib/gcc/i686-linux-gnu/5/../../../i386-linux-gnu/crti.o:(.gnu.linkonce.t.__x86.get_pc_thunk.bx+0x0): first defined here
find_bits.o: In function
系统: Ubuntu 11.10 x86_64 CUDA: v2.1
当我尝试编写一个像matrixMul这样的示例程序时,我得到了大量的错误,其中大多数是“未知的类型名称‘size_t’”。我已确保将/usr/local/cuda/bin放入我的路径中,并将/usr/local/cuda/lib放入/etc/ld.so.conf.d中的.conf中。
你知道为什么我会收到这些错误吗?
matrixMul$ make emu=1
In file included from /tmp/tmpxft_00004089_00000000-1_matrixMul.cudafe1.stub.c:5:0,