@KOS_MOS

C++ — invalid initialization of reference of type

Собираю php_llvm под Убунтой 11.10, когда делаю make вываливается ошибка на исходник на cpp.

Когда делаю make вывливатеся:
In file included from /usr/include/php5/Zend/zend.h:758:0,
from /usr/include/php5/main/php.h:34,
from /home/pavel/pecl_llvm/php-llvm/preprocess_module_template.cpp:36:
/usr/include/php5/Zend/zend_operators.h: In function ?zend_uchar is_numeric_string(const char*, int, long int*, double*, int):
/usr/include/php5/Zend/zend_operators.h:170:49: warning: cast from type ?const char** to type ?char** casts away qualifiers [-Wcast-qual]
/usr/include/php5/Zend/zend_operators.h:181:44: warning: cast from type ?const char** to type ?char** casts away qualifiers [-Wcast-qual]
/home/pavel/pecl_llvm/php-llvm/preprocess_module_template.cpp: In function ?int main(int, char**):
/home/pavel/pecl_llvm/php-llvm/preprocess_module_template.cpp:59:40: error: invalid initialization of non-const reference of type ?llvm::LLVMContext& from an rvalue of type ?std::string* {aka std::basic_string*}
/usr/lib/llvm-2.8/include/llvm/Bitcode/ReaderWriter.h:39:11: error: in passing argument 2 of ?llvm::Module* llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*)
/home/pavel/pecl_llvm/php-llvm/preprocess_module_template.cpp:126:31: error: invalid initialization of reference of type ?llvm::raw_ostream& from expression of type ?std::ofstream {aka std::basic_ofstream}
/usr/lib/llvm-2.8/include/llvm/Bitcode/ReaderWriter.h:45:8: error: in passing argument 2 of ?void llvm::WriteBitcodeToFile(const llvm::Module*, llvm::raw_ostream&)
make: *** [preprocess_module_template] Error 1

кусок кода из preprocess_module_template.cpp:
// Write out the module
verifyModule(*mod, AbortProcessAction);

std::ofstream bc_os(compile_file, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc);
if (bc_os.fail()) {
fprintf(stderr, "failed opening %s for writing the bitcode\n", compile_file);
return 1;
}

WriteBitcodeToFile(mod, bc_os);

126 строка - последняя

Как можно исправить.
В С++ ноль - поэтому затрудняюсь сам.
  • Вопрос задан
  • 3786 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы