编译时报错s_wsfe或e_wsfe等

编译时,报错如下:
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o): In function
`ma27od_':
fort77-18890-1.c:(.text+0x45ac): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x45ca): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x45e4): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x45e9): undefined reference to `e_wsfe'
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o): In function
`ma27nd_':
fort77-18890-1.c:(.text+0x5545): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x5561): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x5586): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x55a7): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x55ac): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x55d5): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x55f4): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x55f9): undefined reference to `e_wsfe'
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o): In function
`ma27jd_':
fort77-18890-1.c:(.text+0x5c20): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x5c3c): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x5c58): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x5c76): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x5c7b): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x618f): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x61ae): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x61b3): undefined reference to `e_wsfe'
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o): In function
`ma27gd_':
fort77-18890-1.c:(.text+0x69dd): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x69f9): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6a15): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6a33): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6a38): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x6a67): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x6a86): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6a8b): undefined reference to `e_wsfe'
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o): In function
`ma27cd_':
fort77-18890-1.c:(.text+0x6b42): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x6b5d): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6b78): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6b93): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6bae): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6bc9): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6bce): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x6cc3): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x6cdb): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6cf3): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6d0b): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6d10): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x6d43): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x6d83): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6da1): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x6db9): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x6dbe): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x6e14): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x6e44): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x6e5c): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x6f0e): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x6f32): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x70a5): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x70aa): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x70d2): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x7113): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x7130): undefined reference to `e_wsfe'
fort77-18890-1.c:(.text+0x71c3): undefined reference to `do_fio'
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o): In function
`ma27bd_':
fort77-18890-1.c:(.text+0x72cf): undefined reference to `s_wsfe'
fort77-18890-1.c:(.text+0x72ea): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x7305): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x7320): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x733b): undefined reference to `do_fio'
fort77-18890-1.c:(.text+0x7356): undefined reference to `do_fio'
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o):fort77-18890-1.c:(.text
+0x7371): more undefined references to `do_fio' follow
/home/eeee/Ipopt-3.5.4/lib/libipopt.a(ma27ad.o): In function
`ma27bd_':
等等,很多这样的错误,解决方法是在编译中加入-lg2c
如:    g++ -O -o maxent maxent.cpp ./opt/lib/maxent_new.a -lg2c  


你可能感兴趣的:(c,function,reference)