undefined reference to `_imp__PathRemoveFileSpecW@4'

Peter Bushnell bushsolo@gmail.com
Tue Jun 13 15:02:00 GMT 2017


The error I'm having trying to compile a Qt GUI program on Windows is...

undefined reference to `_imp__PathRemoveFileSpecW@4'

This should be resolved by adding lshlwapi, however that already
defined at the link below.

https://github.com/kryptkoin/KryptKoin/blob/master/kryptkoin-qt.pro#L383

I've been tinkering with the pro file with no luck. I'm running qmake
with the above linked pro file as follows.

qmake "USE_QRCODE=1" "USE_UPNP=1" "USE_IPV6=1" kryptkoin-qt.pro

When checking the command line I cannot see lshlwapi in there.

g++ -Wl,--large-address-aware -static -static-libgcc -static-libstdc++
-Wl,-s -mthreads -Wl,-subsystem,windows -o release\KryptKoin-qt.exe
object_script.KryptKoin-qt.Release  -L"c:\Qt\4.8.6\lib" -lmingwthrd
-lmingw32 -lqtmain build\bitcoin-qt_res.o -lqrencode
-LC:/deps/miniupnpc -lminiupnpc -liphlpapi -lmswsock
-LC:/deps/boost_1_57_0/stage/lib -LC:/deps/db-4.8.30.NC/build_unix
-LC:/deps/openssl-1.0.1u -LC:/deps/qrencode-3.4.4/.libs -lssl -lcrypto
-ldb_cxx -lboost_system-mgw49-mt-s-1_57
-lboost_filesystem-mgw49-mt-s-1_57
-lboost_program_options-mgw49-mt-s-1_57 -lboost_thread-mgw49-mt-s-1_57
-lboost_chrono-mgw49-mt-s-1_57 -lQtGui -lgdi32 -lcomdlg32 -loleaut32
-limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lole32 -luuid -lws2_32
-ladvapi32 -lshell32 -luser32 -lkernel32

This is the following error.

./build\guiutil.o:guiutil.cpp:(.text+0x13d4): undefined reference to
`_imp__PathRemoveFileSpecW@4'
collect2.exe: error: ld returned 1 exit status

Any help would be appreciated, I've spent hours on this and have made
zero progress.



More information about the Gcc-help mailing list