Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. undefined reference to `_imp__PathRemoveFileSpecW@4'
Qt 6.11 is out! See what's new in the release blog

undefined reference to `_imp__PathRemoveFileSpecW@4'

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bushstar
    wrote on last edited by Bushstar
    #1

    The error I'm having trying to compile a Qt 4.8.6 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
    

    I downloaded and built the Qt 4.8.6 as follows.
    Downloaded from: http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.zip

    configure -release -opensource -confirm-license -static -no-sql-sqlite -no-qt3support -no-opengl -qt-zlib -no-gif -qt-libpng -qt-libmng -no-libtiff -qt-libjpeg -no-dsp -no-vcproj -no-openssl -no-dbus -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-script -no-scripttools -no-declarative -no-declarative-debug -qt-style-windows -qt-style-windowsxp -qt-style-windowsvista -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -nomake demos -nomake examples
    
    mingw32-make
    

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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Why Qt 4 ? It has reached End Of Life. If you're locked to it then please you the latest version available which is 4.8.7.

      Also, why build it yourself ? There are pre-built packages.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved