https://blog.csdn.net/south_d/article/details/126184885
-
#ifdef _WIN32 #include <winsock2.h> #else #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #endif
-
CMakeLists.txt配置
target_link_libraries(multicastdemo_server ws2_32)
,不能使用gcc -lws2_32
的方式,否则仍然会报错:
undefind reference to '_imp_htonl'
等等错误 -
运行exe,各种dll问题。
找不到dll,可以手动下载dll安装,也可以编译加入-static-libgcc
参数。
todo
0 条评论