歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Linux下編譯cppunit1.12.1出現undefined reference to `dlclose的解決方法

Linux下編譯cppunit1.12.1出現undefined reference to `dlclose的解決方法

日期:2017/3/1 10:12:02   编辑:Linux編程

之前沒有用過CPPUnit,可是現在的公司在用。為了准備TDD代碼道場,今天下載了一份。可剛編譯就遇到了問題,查了一下,是原代碼包中的配置項錯了,現象如下:

運行 ./configure 和make以後,出現錯誤:

undefined reference to `dlclose'
undefined reference to `dlopen'
undefined reference to `dlsym'

解決的方法是在 ./configure 後面加上參數LDFLAS=‘-ldl’:

  1. make clean
  2. ./configure LDFLAGS='-ldl'
  3. make
  4. sudo make install
Copyright © Linux教程網 All Rights Reserved