尝试链接c+时出错+;使用llvm 4.2.1的代码 我试图把一些GPL代码(不是我的!)从C++转换成C,这样我就可以在C语言项目中使用它。我读到了关于llvm的文章,非常激动,但我遇到了一个链接器错误,我不知道如何修复:

尝试链接c+时出错+;使用llvm 4.2.1的代码 我试图把一些GPL代码(不是我的!)从C++转换成C,这样我就可以在C语言项目中使用它。我读到了关于llvm的文章,非常激动,但我遇到了一个链接器错误,我不知道如何修复:,llvm,Llvm,错误是: Intrinsic prototype has incorrect number of arguments! void (i8*, i8*, i64, i32, i1)* @llvm.memmove.p0i8.p0i8.i64 Broken module found, compilation aborted! Stack dump: 0. Running pass 'Function Pass Manager' on module 'ld-temp.o'. 1. Running p

错误是:

Intrinsic prototype has incorrect number of arguments!
void (i8*, i8*, i64, i32, i1)* @llvm.memmove.p0i8.p0i8.i64
Broken module found, compilation aborted!
Stack dump:
0.  Running pass 'Function Pass Manager' on module 'ld-temp.o'.
1.  Running pass 'Module Verifier' on function '@_ZNSt15__copy_backwardILb1ESt26random_access_iterator_tagE8__copy_bIxEEPT_PKS3_S6_S4_'
有人见过这个吗?知道是什么引起的吗

以下是我用来实现这一目标的命令:

dhcp-100-140:src joeltucci$ llvm-g++ msb.C -c -emit-llvm
dhcp-100-140:src joeltucci$ llvm-g++ rabincmd.C -c -emit-llvm
In file included from rabincmd.C:27:
rabinpoly.h: In member function ‘u_int64_t rabinpoly::append8(u_int64_t, u_char) const’:
rabinpoly.h:56: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
rabincmd.C: In function ‘void printChunkContents(u_int64_t, const unsigned char*, int)’:
rabincmd.C:91: warning: too few arguments for format
rabincmd.C: In member function ‘virtual void ExtractChunkProcessor::internalCompleteChunk(u_int64_t, u_int64_t)’:
rabincmd.C:547: warning: deprecated conversion from string constant to ‘char*’
rabincmd.C:551: warning: deprecated conversion from string constant to ‘char*’
dhcp-100-140:src joeltucci$ llvm -ld m
mkrabincmd.sh      msb.C              msb.o              
mkverboseRabin.sh  msb.h              
dhcp-100-140:src joeltucci$ llvm -ld *.o -o program
-bash: llvm: command not found
dhcp-100-140:src joeltucci$ llvm-ld *.o -o program
-bash: llvm-ld: command not found
dhcp-100-140:src joeltucci$ llvm-
llvm-cpp-4.2  llvm-g++      llvm-g++-4.2  llvm-gcc      llvm-gcc-4.2  
dhcp-100-140:src joeltucci$ llvm-g++ *.o -o program
collect2: ld terminated with signal 6 [Abort trap]
Intrinsic prototype has incorrect number of arguments!
void (i8*, i8*, i64, i32, i1)* @llvm.memmove.p0i8.p0i8.i64
Broken module found, compilation aborted!
Stack dump:
0.  Running pass 'Function Pass Manager' on module 'ld-temp.o'.
1.  Running pass 'Module Verifier' on function '@_ZNSt15__copy_backwardILb1ESt26random_access_iterator_tagE8__copy_bIxEEPT_PKS3_S6_S4_'
dhcp-100-140:src joeltucci$ llvm-gcc --version
i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2332.3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

dhcp-100-140:src joeltucci$ 
dhcp-100-140:src joeltucci$ 
dhcp-100-140:src joeltucci$ 
dhcp-100-140:src joeltucci$ llvm-g++ *.o -o program
llvm-g++      llvm-g++-4.2  
dhcp-100-140:src joeltucci$ llvm-gcc-4.2 --version
i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2332.3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

你的问题可能是排队

llvm -ld *.o -o program -bash: llvm: command not found dhcp-100-140:src 

您列出的错误很可能与未找到llvm-ld有关,因此您在下一个命令中丢失了一些所需的文件。。。。。你是说llvm ld吗?

你的问题可能是排队

llvm -ld *.o -o program -bash: llvm: command not found dhcp-100-140:src 
您列出的错误很可能与未找到llvm-ld有关,因此您在下一个命令中丢失了一些所需的文件。。。。。你是说llvm ld吗