2012-02-22 39 views
11

Tôi đang làm việc để xây dựng chuỗi công cụ ios với số tutorial này. Khi tôi chạy lệnh, hãy tạo ENABLE_OPTIMIZED = 1 Tôi nhận được kết quả này.‘strcmp’ không được khai báo trong phạm vi này

llvm[0]: Reconfiguring with /home/connor/llvm-svn/configure 
config.status: creating Makefile.config 
config.status: creating llvm.spec 
config.status: creating docs/doxygen.cfg 
config.status: creating tools/llvm-config/llvm-config.in 
config.status: creating include/llvm/Config/config.h 
config.status: creating include/llvm/Support/DataTypes.h 
config.status: include/llvm/Support/DataTypes.h is unchanged 
config.status: creating include/llvm/ADT/hash_map 
config.status: include/llvm/ADT/hash_map is unchanged 
config.status: creating include/llvm/ADT/hash_set 
config.status: include/llvm/ADT/hash_set is unchanged 
config.status: creating include/llvm/ADT/iterator 
config.status: include/llvm/ADT/iterator is unchanged 
config.status: executing setup commands 
config.status: executing Makefile commands 
config.status: executing Makefile.common commands 
config.status: executing examples/Makefile commands 
config.status: executing lib/Makefile commands 
config.status: executing runtime/Makefile commands 
config.status: executing test/Makefile commands 
config.status: executing test/Makefile.tests commands 
config.status: executing tools/Makefile commands 
config.status: executing utils/Makefile commands 
config.status: executing projects/Makefile commands 
config.status: executing bindings/Makefile commands 
config.status: executing bindings/ocaml/Makefile.ocaml commands 
make[1]: Entering directory `/home/connor/llvm-svn/lib/System' 
llvm[1]: Compiling Alarm.cpp for Release build 
llvm[1]: Compiling Disassembler.cpp for Release build 
Disassembler.cpp: In function ‘std::string llvm::sys::disassembleBuffer(uint8_t*, size_t, uint64_t)’: 
Disassembler.cpp:44:12: warning: variable ‘bits’ set but not used [-Wunused-but-set-variable] 
llvm[1]: Compiling DynamicLibrary.cpp for Release build 
DynamicLibrary.cpp: In static member function ‘static void* llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char*)’: 
DynamicLibrary.cpp:178:5: error: ‘strcmp’ was not declared in this scope 
DynamicLibrary.cpp:178:5: error: ‘stderr’ was not declared in this scope 
DynamicLibrary.cpp:179:5: error: ‘strcmp’ was not declared in this scope 
DynamicLibrary.cpp:179:5: error: ‘stdout’ was not declared in this scope 
DynamicLibrary.cpp:180:5: error: ‘strcmp’ was not declared in this scope 
DynamicLibrary.cpp:180:5: error: ‘stdin’ was not declared in this scope 
make[1]: *** [/home/connor/llvm-svn/lib/System/Release/DynamicLibrary.o] Error 1 
make[1]: Leaving directory `/home/connor/llvm-svn/lib/System' 
make: *** [all] Error 1 

Tôi không chắc phải làm gì với điều này và googling của tôi không giúp được gì nhiều.

+1

'strcmp' được khai báo trong' string.h' cố gắng đặt '#include ' trong 'DynamicLibrary.cpp' và stderr được giữ nguyên trong' stdio.h' để đặt quá. – jcubic

+0

@jcubic đăng nhận xét của bạn dưới dạng câu trả lời. – 0xDE4E15B

+0

Không hiểu điều này. Có thể thử chạy './Configure' một lần nữa. – jcubic

Trả lời

18

chức năng strcmp được khai báo trong string.h cố gắng đưa

#include <string.h> 

trong DynamicLibrary.cpp và stderr được defained trong stdio.h nên đặt quá

#include <stdio.h> 

Thỉnh thoảng tôi tìm thấy mã nguồn mở với các tệp tiêu đề bị thiếu.

+0

cảm ơn vì nó cố định hầu hết mọi thứ. Bây giờ khi tôi biên dịch tôi chỉ có lỗi này: llvm [0]: Cấu hình lại với/home/connor/llvm-svn/configure make: *** [/home/connor/llvm-svn/config.status] Lỗi 1 – connor

+0

Bạn có thể thử tạo một câu hỏi khác cho điều này. – jcubic

Các vấn đề liên quan