Results 1 to 3 of 3

Thread: Qt Creator error: /NODEFAULTLIB:library: No such file or directory

  1. #1

    Default Qt Creator error: /NODEFAULTLIB:library: No such file or directory

    In Qt Creator ,Application.pro I have these lines of code:
    ...
    #------------------------------------------------------------------------------
    # Compiler flags:
    #------------------------------------------------------------------------------



    CONFIG += warn_off

    QMAKE_LFLAGS += -Wl,-rpath,$$(VTKHOME)/lib/vtk-5.2

    win32 {
    QMAKE_LFLAGS += /NODEFAULTLIB:library
    }

    QMAKE_CXXFLAGS_DEBUG += -g
    QMAKE_CXXFLAGS += -g

    ...


    when I run the project I got this error:
    error: /NODEFAULTLIB:library: No such file or directory


    Its maybe related to qt creator environment settings ,or program codes.

    As I changed This
    CONFIG += warn_off


    to
    CONFIG += static


    there is no error but a window opens and want to specify an executable File, and at last Run * and below is the message

    No executable specified.

    I have these files in my release folder:
    AppGUI_res.o
    libApp.a
    libtest.a


    so what should I do to Execute my program ,It Built with no errors.
    Last edited by hasanbaghal; 2nd December 2017 at 23:47.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt Creator error: /NODEFAULTLIB:library: No such file or directory

    I looks like you are using MingW to compile the application (from the file extensions) but the application.pro has been written on the assumption you are using the Microsoft compiler toolchain. The MingW linker will get "/NODEFAULTLIB:library" as an argument and try to treat it as a file name giving the error message you posted.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt Creator error: /NODEFAULTLIB:library: No such file or directory

    "/NODEFAULTLIB:library"
    I am not even sure this is correct syntax for MSVC - I think "library" must be replaced with the actual name of the library to exclude. See MSDN here.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 2
    Last Post: 17th January 2016, 01:15
  2. Replies: 12
    Last Post: 19th August 2015, 19:50
  3. Replies: 3
    Last Post: 16th March 2015, 09:05
  4. Replies: 2
    Last Post: 27th May 2010, 16:12
  5. Replies: 4
    Last Post: 9th May 2010, 17:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.