+ Reply to Thread
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,446
    Thanks
    13
    Thanked 1,560 Times in 1,490 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
    3,448
    Thanks
    203
    Thanked 535 Times in 525 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    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.

+ Reply to Thread

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