简体   繁体   English

如何将ws2_32.lib与自动工具链接

[英]How to link ws2_32.lib with autotools

I'm trying my C code to build with autotools on mingw+msys. 我正在尝试在mingw + msys上使用自动工具构建C代码。

Could you tell me how to link library like ws2_32.lib when I use autotools . 您能告诉我在使用autotools时如何链接ws2_32.lib库。

I think I have to edit configure.ac or Makefile.am . 我想我必须编辑configure.acMakefile.am

At the linking process of your makefile, add the library you want to link. 在makefile的链接过程中,添加要链接的库。

For MingW to link with <name>.lib , You may refer to Specify the libraries for the linker to use 为了使MingW与<name>.lib链接,您可以参考指定链接器要使用的库

Like this, in the Makefile.am: 像这样,在Makefile.am中:

AM_LDFLAGS = -lws2_32

bin_PROGRAMS = myApp
myApp_SOURCES = myApp.c
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM