Tiny C Compiler (TCC) and winsock?

这一生的挚爱 提交于 2019-11-29 02:31:42

According to Tinycc-devel mailing list

you should give this a try:

tiny_impdef winsock.dll -o winsock.def
tcc yourcode.c  winsock.def -o yourcode.exe
  1. Use tiny_impdef.exe to export definitions from the DLL file using the command line:
    tiny_impdef.exe wsock32.dll -o .\lib\wsock32.def

  2. You will also need the header files for your source code to include them. MinGW's ones (such as winsock2.h, ws2tcpip.h, ws2spi.h...) can be reused with TCC.
    The MinGW compiler can be downloaded from here. Just copy the headers you need from MinGW's include directory to TCC's include\winapi directory.

  3. At compilation time, you will need to tell the compiler you are using the Windows socket library:
    tcc.exe path\to\code.c -lwsock32 -o path\to\program.exe

tiny_impdef winsock.dll 

copy winsock.def to lib/

run:

tcc -lwinsock yourcode.c -o yourcode.exe
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!