从Linux到Windows的移植应用程序(在MiniUpnPC的顶部制造),尝试使用mingw构建,链接Windows上的故障

发布于 01-21 08:21 字数 15011 浏览 3 评论 0原文

我是MingW的新手,并试图移植我在MiniUpnPC之上构建的应用程序。 该应用程序在Linux上运行良好,但由于链接错误,无法在Windows上编译它。

我使用的是mingw64(通过msys2安装)并安装了以下库:

pacman -S base-devel mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-miniupnpc

问题: 我不确定我缺少的是导致此链接错误的原因。 任何指示我如何解决此问题并获取成功构建的应用程序?

错误:

gcc -o ../bin/pjmedia-test-x86_64-w64-mingw32 \
     output/pjmedia-test-x86_64-w64-mingw32/codec_vectors.o  output/pjmedia-test-x86_64-w64-mingw32/jbuf_test.o  output/pjmedia-test-x86_64-w64-mingw32/main.o  output/pjmedia-test-x86_64-w64-mingw32/mips_test.o  output/pjmedia-test-x86_64-w64-mingw32/vid_codec_test.o  output/pjmedia-test-x86_64-w64-mingw32/vid_dev_test.o  output/pjmedia-test-x86_64-w64-mingw32/vid_port_test.o  output/pjmedia-test-x86_64-w64-mingw32/rtp_test.o  output/pjmedia-test-x86_64-w64-mingw32/test.o  output/pjmedia-test-x86_64-w64-mingw32/sdp_neg_test.o -lpjmedia-codec-x86_64-w64-mingw32 -lpjmedia-videodev-x86_64-w64-mingw32 -lpjmedia-audiodev-x86_64-w64-mingw32 -lpjmedia-x86_64-w64-mingw32 -lpjnath-x86_64-w64-mingw32 -lpjlib-util-x86_64-w64-mingw32 -lpj-x86_64-w64-mingw32 -lsrtp-x86_64-w64-mingw32 -lresample-x86_64-w64-mingw32 -lgsmcodec-x86_64-w64-mingw32 -lspeex-x86_64-w64-mingw32 -lilbccodec-x86_64-w64-mingw32 -lg7221codec-x86_64-w64-mingw32 -lyuv-x86_64-w64-mingw32 -lminiupnpc-x86_64-w64-mingw32 -lwebrtc-x86_64-w64-mingw32 -lbaseclasses-x86_64-w64-mingw32   -lssl -lcrypto -lopenh264 -lstdc++ -lm -lwinmm -lole32 -lws2_32 -lwsock32 -lpthread  -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2      -LC:/workspace/pjsip/pjlib/lib -LC:/workspace/pjsip/pjlib-util/lib -LC:/workspace/pjsip/pjnath/lib -LC:/workspace/pjsip/pjmedia/lib -LC:/workspace/pjsip/pjsip/lib -LC:/workspace/pjsip/third_party/lib -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2    -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -lopenh264 -lstdc++  -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2    -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -lopenh264 -lstdc++   -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2    -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -lopenh264 -lstdc++
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x86): undefined reference to `__imp_UPNP_GetConnectionTypeInfo'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0xc3): undefined reference to `__imp_UPNP_GetStatusInfo'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0xfe): undefined reference to `__imp_UPNP_GetLinkLayerMaxBitRates'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x122): undefined reference to `__imp_UPNP_GetExternalIPAddress'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x4be): undefined reference to `__imp_UPNP_GetExternalIPAddress'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x531): undefined reference to `__imp_UPNP_AddAnyPortMapping'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x58e): undefined reference to `__imp_UPNP_GetSpecificPortMappingEntry'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x64a): undefined reference to `__imp_UPNP_AddPortMapping'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x663): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x698): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x6f4): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x53c): undefined reference to `__imp_UPNP_GetIGDFromUrl'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x57c): undefined reference to `__imp_UPNP_GetValidIGD'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x60b): undefined reference to `__imp_FreeUPNPUrls'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x616): undefined reference to `__imp_freeUPNPDevlist'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x8d6): undefined reference to `__imp_upnpDiscover'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa37): undefined reference to `__imp_UPNP_GetTotalBytesSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa4b): undefined reference to `__imp_UPNP_GetTotalBytesReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa5f): undefined reference to `__imp_UPNP_GetTotalPacketsSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa73): undefined reference to `__imp_UPNP_GetTotalPacketsReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xc0f): undefined reference to `__imp_UPNP_DeletePortMappingRange'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xc76): undefined reference to `__imp_UPNP_GetListOfPortMappings'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xd1a): undefined reference to `__imp_FreePortListing'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdc1): undefined reference to `__imp_FreePortListing'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdce): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdef): undefined reference to `__imp_UPNP_GetPinholePackets'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdf6): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xf0a): undefined reference to `__imp_UPNP_GetOutboundPinholeTimeout'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xf1c): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xf6a): undefined reference to `__imp_UPNP_DeletePinhole'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xfce): undefined reference to `__imp_UPNP_CheckPinholeWorking'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x104b): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x117e): undefined reference to `__imp_UPNP_AddPinhole'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1190): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x120c): undefined reference to `__imp_UPNP_DeletePortMapping'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x130a): undefined reference to `__imp_UPNP_CheckPinholeWorking'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x136a): undefined reference to `__imp_UPNP_UpdatePinhole'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x138e): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x13ec): undefined reference to `__imp_UPNP_GetFirewallStatus'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x144d): undefined reference to `__imp_UPNP_GetTotalBytesSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1461): undefined reference to `__imp_UPNP_GetTotalBytesReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1475): undefined reference to `__imp_UPNP_GetTotalPacketsSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1489): undefined reference to `__imp_UPNP_GetTotalPacketsReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1670): undefined reference to `__imp_UPNP_GetGenericPortMappingEntry'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1680): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x177a): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x179f): undefined reference to `__imp_strupnperror'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [C:/workspace/pjsip/build/rules.mak:125: ../bin/pjmedia-test-x86_64-w64-mingw32] Error 1
make[2]: Leaving directory '/c/workspace/pjsip/pjmedia/build'
make[1]: *** [Makefile:245: pjmedia-test-x86_64-w64-mingw32] Error 2
make[1]: Leaving directory '/c/workspace/pjsip/pjmedia/build'
make: *** [Makefile:14: all] Error 1

I am a newbie with mingw and trying to port an application I have built on top of miniupnpc.
The application works fine on linux but unable to compile it on windows because of a linking error.

I am using mingw64 (installed via msys2) and installed following libraries:

pacman -S base-devel mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-miniupnpc

Question:
I am not sure what I am missing that is causing this linking error.
Any pointers how I can resolve this issue and get my application to build successfully??

Error:

gcc -o ../bin/pjmedia-test-x86_64-w64-mingw32 \
     output/pjmedia-test-x86_64-w64-mingw32/codec_vectors.o  output/pjmedia-test-x86_64-w64-mingw32/jbuf_test.o  output/pjmedia-test-x86_64-w64-mingw32/main.o  output/pjmedia-test-x86_64-w64-mingw32/mips_test.o  output/pjmedia-test-x86_64-w64-mingw32/vid_codec_test.o  output/pjmedia-test-x86_64-w64-mingw32/vid_dev_test.o  output/pjmedia-test-x86_64-w64-mingw32/vid_port_test.o  output/pjmedia-test-x86_64-w64-mingw32/rtp_test.o  output/pjmedia-test-x86_64-w64-mingw32/test.o  output/pjmedia-test-x86_64-w64-mingw32/sdp_neg_test.o -lpjmedia-codec-x86_64-w64-mingw32 -lpjmedia-videodev-x86_64-w64-mingw32 -lpjmedia-audiodev-x86_64-w64-mingw32 -lpjmedia-x86_64-w64-mingw32 -lpjnath-x86_64-w64-mingw32 -lpjlib-util-x86_64-w64-mingw32 -lpj-x86_64-w64-mingw32 -lsrtp-x86_64-w64-mingw32 -lresample-x86_64-w64-mingw32 -lgsmcodec-x86_64-w64-mingw32 -lspeex-x86_64-w64-mingw32 -lilbccodec-x86_64-w64-mingw32 -lg7221codec-x86_64-w64-mingw32 -lyuv-x86_64-w64-mingw32 -lminiupnpc-x86_64-w64-mingw32 -lwebrtc-x86_64-w64-mingw32 -lbaseclasses-x86_64-w64-mingw32   -lssl -lcrypto -lopenh264 -lstdc++ -lm -lwinmm -lole32 -lws2_32 -lwsock32 -lpthread  -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2      -LC:/workspace/pjsip/pjlib/lib -LC:/workspace/pjsip/pjlib-util/lib -LC:/workspace/pjsip/pjnath/lib -LC:/workspace/pjsip/pjmedia/lib -LC:/workspace/pjsip/pjsip/lib -LC:/workspace/pjsip/third_party/lib -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2    -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -lopenh264 -lstdc++  -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2    -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -lopenh264 -lstdc++   -LC:/msys64/mingw64/lib -lmingw32 -lSDL2main -lSDL2    -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids  -lopenh264 -lstdc++
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x86): undefined reference to `__imp_UPNP_GetConnectionTypeInfo'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0xc3): undefined reference to `__imp_UPNP_GetStatusInfo'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0xfe): undefined reference to `__imp_UPNP_GetLinkLayerMaxBitRates'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x122): undefined reference to `__imp_UPNP_GetExternalIPAddress'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x4be): undefined reference to `__imp_UPNP_GetExternalIPAddress'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x531): undefined reference to `__imp_UPNP_AddAnyPortMapping'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x58e): undefined reference to `__imp_UPNP_GetSpecificPortMappingEntry'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x64a): undefined reference to `__imp_UPNP_AddPortMapping'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x663): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x698): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text+0x6f4): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x53c): undefined reference to `__imp_UPNP_GetIGDFromUrl'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x57c): undefined reference to `__imp_UPNP_GetValidIGD'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x60b): undefined reference to `__imp_FreeUPNPUrls'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x616): undefined reference to `__imp_freeUPNPDevlist'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x8d6): undefined reference to `__imp_upnpDiscover'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa37): undefined reference to `__imp_UPNP_GetTotalBytesSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa4b): undefined reference to `__imp_UPNP_GetTotalBytesReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa5f): undefined reference to `__imp_UPNP_GetTotalPacketsSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xa73): undefined reference to `__imp_UPNP_GetTotalPacketsReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xc0f): undefined reference to `__imp_UPNP_DeletePortMappingRange'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xc76): undefined reference to `__imp_UPNP_GetListOfPortMappings'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xd1a): undefined reference to `__imp_FreePortListing'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdc1): undefined reference to `__imp_FreePortListing'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdce): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdef): undefined reference to `__imp_UPNP_GetPinholePackets'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xdf6): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xf0a): undefined reference to `__imp_UPNP_GetOutboundPinholeTimeout'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xf1c): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xf6a): undefined reference to `__imp_UPNP_DeletePinhole'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0xfce): undefined reference to `__imp_UPNP_CheckPinholeWorking'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x104b): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x117e): undefined reference to `__imp_UPNP_AddPinhole'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1190): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x120c): undefined reference to `__imp_UPNP_DeletePortMapping'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x130a): undefined reference to `__imp_UPNP_CheckPinholeWorking'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x136a): undefined reference to `__imp_UPNP_UpdatePinhole'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x138e): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x13ec): undefined reference to `__imp_UPNP_GetFirewallStatus'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x144d): undefined reference to `__imp_UPNP_GetTotalBytesSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1461): undefined reference to `__imp_UPNP_GetTotalBytesReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1475): undefined reference to `__imp_UPNP_GetTotalPacketsSent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1489): undefined reference to `__imp_UPNP_GetTotalPacketsReceived'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1670): undefined reference to `__imp_UPNP_GetGenericPortMappingEntry'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x1680): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x177a): undefined reference to `__imp_strupnperror'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/workspace/pjsip/third_party/lib/libminiupnpc-x86_64-w64-mingw32.a(upnpc.o):upnpc.c:(.text.startup+0x179f): undefined reference to `__imp_strupnperror'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [C:/workspace/pjsip/build/rules.mak:125: ../bin/pjmedia-test-x86_64-w64-mingw32] Error 1
make[2]: Leaving directory '/c/workspace/pjsip/pjmedia/build'
make[1]: *** [Makefile:245: pjmedia-test-x86_64-w64-mingw32] Error 2
make[1]: Leaving directory '/c/workspace/pjsip/pjmedia/build'
make: *** [Makefile:14: all] Error 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃颗糖壮壮胆2025-01-28 08:21:07

您可以与-lminiupnpc-x86_64-W64-MingW32链接。
您是否有libminiupnpc-x86_64-w64-mingw32.dll.a,或者只是libminiupnpc-x86_64-w64-w64-mingw32.a
因为错误表明它试图与dllimported符号链接...

如果要使用静态库,则可以通过添加编译器flag -dminiupnp_staticlib来告诉您Miniiupnpc header文件以使用静态文件来使用静态文件来使用静态。符号。

You link with -lminiupnpc-x86_64-w64-mingw32.
Do you have libminiupnpc-x86_64-w64-mingw32.dll.a, or just libminiupnpc-x86_64-w64-mingw32.a?
Because the error indicates it's trying to link with dllimported symbols...

If you want to use the static library you can get around that by adding compiler flag -DMINIUPNP_STATICLIB to tell the miniupnpc header files to use the static symbols.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文