我正在運行 g++ 4.9.2.0ubuntu1~14.04 (從工具鏈 ppa 安裝:ppa:ubuntu-toolchain-r/test),並且我想使用虛擬表驗證 (VTV) 功能(-fvtable-verify
在C++ 方言選項)。當我運行命令時:
g++ -fvtable-verify=std -o test test.cpp
連結器退出並出現以下錯誤:
/usr/bin/ld: cannot find vtv_start.o: No such file or directory
/usr/bin/ld: cannot find -lvtv
g++ 5.1 也會出現相同的錯誤。知道可能出了什麼問題嗎?我是否應該安裝任何其他軟體包才能使 VTV 正常工作?
更新。嘗試libvtv
使用手動安裝apt-get install libvtv0
失敗並出現以下錯誤:
The following packages have unmet dependencies:
libvtv0 : Depends: gcc-4.9-base (= 4.9-20140406-1ubuntu1) but 4.9.2-0ubuntu1~14.04 is to be installed
答案1
gcc
從原始碼重新編譯--enable-vtable-verify
解決了問題。