簡體   English   中英

C ++編譯錯誤-未定義參考

[英]c++ compilation error- undefined reference

我的cpp文件具有ScilabOctave頭文件。 我正在嘗試使用此命令進行編譯

g++ -l:/usr/lib/scilab/libscilab.so -L/usr/lib/scilab -L/usr/lib/scilab -I/usr/include/octave-3.8.1 -I/usr/include/octave-3.8.1/octave -I/usr/include/scilab s_o_test_v4.cpp -o s_o_test_v4

我收到以下錯誤

s_o_test_v4.cpp:(.text+0x5f4): undefined reference to `pvApiCtx'
s_o_test_v4.cpp:(.text+0x5ff): undefined reference to `isVarMatrixType'
s_o_test_v4.cpp:(.text+0x61a): undefined reference to `pvApiCtx'
s_o_test_v4.cpp:(.text+0x644): undefined reference to `getMatrixOfDouble'
s_o_test_v4.cpp:(.text+0x743): undefined reference to `string_vector::c_str_vec() const'
s_o_test_v4.cpp:(.text+0x755): undefined reference to `octave_main'
s_o_test_v4.cpp:(.text+0x7a2): undefined reference to `octave_value::octave_value(double)'
s_o_test_v4.cpp:(.text+0x847): undefined reference to `feval(std::string const&, octave_value_list const&, int)'
s_o_test_v4.cpp:(.text+0x8a3): undefined reference to `pvApiCtx'

Scilab和Octave函數均顯示錯誤。 我應該在編譯命令中包含或刪除某些內容嗎?

也許您的make命令的順序是錯誤的,另請參見以下SO問題

另請注意,需要在需要文件的文件后在命令行上指定它們

那將使您的命令:

g++ -I/usr/include/octave-3.8.1 -I/usr/include/octave-3.8.1/octave -I/usr/include/scilab s_o_test_v4.cpp -o s_o_test_v4 -l:/usr/lib/scilab/libscilab.so -L/usr/lib/scilab -L/usr/lib/scilab

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM