次のコマンドを使用して、システムに libmcrypt をインストールしました。
avinash@ak-pc:~/Documents/network_lab/tut7$ cd libmcrypt-2.5.8
avinash@ak-pc:~/Documents/network_lab/tut7/libmcrypt-2.5.8$ ./configure --prefix=/usr --disable-posix-threads
avinash@ak-pc:~/Documents/network_lab/tut7/libmcrypt-2.5.8$ make
avinash@ak-pc:~/Documents/network_lab/tut7/libmcrypt-2.5.8$ sudo make install
その結果、ヘッダーは /usr/include に移動し、ライブラリは /usr/lib に移動しました。ここで、 < mcrypt.h> を .cpp ファイルにインクルードして libmcrypt が提供する関数を使用すると、コンパイラが通知します
/tmp/ccCot4nH.o: In function `main':
q3.cpp:(.text+0x64): undefined reference to `mcrypt_module_open'
q3.cpp:(.text+0xb9): undefined reference to `mcrypt_generic_init'
q3.cpp:(.text+0xd6): undefined reference to `mcrypt_generic'
q3.cpp:(.text+0x110): undefined reference to `mdecrypt_generic'
q3.cpp:(.text+0x13a): undefined reference to `mcrypt_generic_deinit'
q3.cpp:(.text+0x147): undefined reference to `mcrypt_module_close'
collect2: ld returned 1 exit status
問題がどこにあるか誰か教えてもらえますか? インストール手順に何か問題がありましたか?