我用mpir(在windows上)編寫了一個公鑰 - 私鑰生成器,它工作正常。Linux上的GMP(MPIR)鏈接器錯誤
當我嘗試在使用gmp庫的linux機器上編譯它時,它會引發大量鏈接器錯誤。
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has invali
d symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 1 has invali
d symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 2 has invali
d symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 3 has invali
d symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 4 has invali
d symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 5 has invali
d symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 6 has invali
d symbol index 13
...
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start'
:
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
我正在使用g++ -lgmp prime.cpp
。我沒有使用任何非gmp函數。任何想法?我不添加代碼,因爲它有很多。
什麼是海灣合作委員會的命令是什麼? – stark 2012-04-22 17:52:56
g ++ -lgmp key.cpp – questions 2012-04-22 18:02:28
你能編譯一個基本的(C)「hello world」程序嗎? – Mat 2012-04-22 18:09:15