Results 1 to 4 of 4

Thread: QT Creator - Ignore Includes

  1. #1
    Join Date
    Jul 2011
    Location
    Santa Clara, CA
    Posts
    13
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QT Creator - Ignore Includes

    Hey,

    I love QT Creator, best IDE ever, I have no idea why anybody would NOT use this for all their C/C++ needs. I've used QT Creator for quite awhile now and like to think I know it pretty good. Though recently, I ran into a problem where QT Creator is having trouble.

    The problem is that I need it to resolve symbols that it knows are there, but aren't necessarily "included" in the file.

    For example, if I have a file, file A, and there's a function, func1, which resides in file B, then I need to be able to call it in file A without it saying it can't resolve it. It resolves it fine if I include file B in file A, so it definitely parsed it.

    The problem is that I am unable to modify the include statements, and I'm obviously using compilation outside of QT...so I need it to like...ignore what's in the include statements and search for the symbol globally, if that makes any sense. Unfortunately not all the includes are there, like they should be, but the project still compiles. I wish I was able to add the necessary includes, but I am not allowed to .

    Can anybody help me here?

    Yes, I realize this is a weird request, but sometimes you have all the control, sometimes you have none :-\.

    TIA .

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QT Creator - Ignore Includes

    A extern func1 in file A can be used instead including file B, see if this fits your needs

  3. #3
    Join Date
    Jul 2011
    Location
    Santa Clara, CA
    Posts
    13
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT Creator - Ignore Includes

    Quote Originally Posted by Santosh Reddy View Post
    A extern func1 in file A can be used instead including file B, see if this fits your needs
    Not quite. I'm not in need of a C/C++ mechanism to do so, I'm in need of QT Creator acting "as if" I've included file B into file A.

    Sometimes you are only allowed to change a small piece of a file (sometimes you have control over all the files...sometimes you don't). The problem I'm running into is that QT Creator won't resolve the symbol in file A because file B isn't included into file A - though they're linked somehow, probably by way of extern, possibly by way of compiler magic - but there's a different build mechanism which takes care of the compilation & linking, I am only using QT Creator for the editing.

    Hope that clears things up a bit. I basically need to ask QT Creator if it can resolve the symbol based on what's in the .includes file, regardless of whether or not the includes are explicitly listed as preprocessor directives in the files.

    The problem is I'm just getting a bunch of "I have no idea what this is" from QT Creator, but then as soon as I include the file, it's okay. Though I can't leave the file modified and I like the ability to jump to symbols' definitions.

  4. #4
    Join Date
    Jul 2011
    Location
    Santa Clara, CA
    Posts
    13
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT Creator - Ignore Includes

    *bump

    Anybody? I can't be the first person to run into this problem..

Similar Threads

  1. Qt Creator problem with Mingw includes
    By doijunior in forum General Programming
    Replies: 3
    Last Post: 23rd July 2011, 01:58
  2. includes from headers
    By BadKnees in forum Qt Programming
    Replies: 2
    Last Post: 31st March 2009, 08:55
  3. qFromLittleEndian what includes to use?
    By nunyabeezwax in forum Qt Programming
    Replies: 3
    Last Post: 14th August 2008, 14:36
  4. Doubt about includes
    By xEsk in forum Newbie
    Replies: 2
    Last Post: 15th November 2007, 20:20
  5. How to use C++ includes?
    By jochen_r in forum Newbie
    Replies: 4
    Last Post: 9th January 2006, 14:34

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.