为什么无法在计算机上编译我的mruby代码?

时间:2018-11-16 20:58:53

标签: c gcc mingw c99 mruby

我的计算机上有Mingw GCC。现在我想编译mruby,但是出现错误消息。

我已经像使用手册中那样用make编译了mruby。然后,如手册中所述,我运行了GCC命令,但它返回了一条错误消息:

gcc -std=c99 -IE:/mruby-1.4.1/include test.c -o test.exe E:/mruby-1.4.1/build/host/lib/libmruby.a -lm

我使用Windows 10 64位,mruby 1.4.1和gcc 6.3.0。

错误消息:

E:/mruby-1.4.1/build/host/lib/libmruby.a(io.o): In function `fptr_finalize':
E:/mruby-1.4.1/mrbgems/mruby-io/src/io.c:654: undefined reference to `closesocket@4'
E:/mruby-1.4.1/mrbgems/mruby-io/src/io.c:655: undefined reference to `WSAGetLastError@0'
E:/mruby-1.4.1/build/host/lib/libmruby.a(io.o): In function `_FD_ISSET':
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
E:/mruby-1.4.1/build/host/lib/libmruby.a(io.o):c:/mingw/include/winsock.h:138: more undefined references to `__WSAFDIsSet@8' follow
E:/mruby-1.4.1/build/host/lib/libmruby.a(io.o): In function `mrb_io_s_select':
E:/mruby-1.4.1/mrbgems/mruby-io/src/io.c:1147: undefined reference to `select@20'
E:/mruby-1.4.1/build/host/lib/libmruby.a(io.o): In function `_FD_ISSET':
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
c:/mingw/include/winsock.h:138: undefined reference to `__WSAFDIsSet@8'
E:/mruby-1.4.1/build/host/lib/libmruby.a(io.o):c:/mingw/include/winsock.h:138: more undefined references to `__WSAFDIsSet@8' follow
collect2.exe: error: ld returned 1 exit status

0 个答案:

没有答案