Results 1 to 2 of 2

Thread: #include "MathFunctions" highlights with "no such file"

  1. #1
    Join Date
    Nov 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default #include "MathFunctions" highlights with "no such file"

    Hello,
    From a Qt Creator 4.1.0 Based on Qt 5.7.0 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit),
    I create a library: File > New File or Project > Library > C++ Library
    called "MathFunctions" and does't touch a file. So there are the skeleton files, and build them, with the release and debug flavors; all going well without errors.

    Now I create another project: File > New File or Project > Application > Qt Console Application: "MathFunctionsTest"
    After that, right click over the project "MathFunctionsTest" and: Add library > External library

    selected: Library file; Include path; Linux
    MathFunctionsTest.pro ends up with this snippet inserted:

    Qt Code:
    1. unix:!macx: LIBS += -L$$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release/ -lMathFunctions
    2.  
    3. INCLUDEPATH += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release
    4. DEPENDPATH += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release
    5.  
    6. unix:!macx: PRE_TARGETDEPS += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release/libMathFunctions.a
    To copy to clipboard, switch view to plain text mode 

    Now I go to main.cpp and try to add:

    #include "MathFunctions"
    Qt creator highlights with "no such file", but directories and files do exist.

    Please, any ideas?

    Regards

  2. #2
    Join Date
    Nov 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: #include "MathFunctions" highlights with "no such file"

    Solved, forget to execute "Run qmake"

    EDIT: After changing the INCLUDEPATH line incorrectly edited by Add library > External library.

    The bad one:
    Qt Code:
    1. INCLUDEPATH += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release
    To copy to clipboard, switch view to plain text mode 

    The good one:
    Qt Code:
    1. INCLUDEPATH += $$PWD/../../MathFunctions/MathFunctions
    To copy to clipboard, switch view to plain text mode 
    Last edited by framontb; 2nd November 2016 at 00:06.

Similar Threads

  1. Replies: 1
    Last Post: 20th November 2015, 11:02
  2. Replies: 3
    Last Post: 16th March 2015, 08:31
  3. Replies: 3
    Last Post: 15th February 2010, 18:27
  4. Replies: 3
    Last Post: 8th July 2008, 20:37
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

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.