Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QT Creator autocomplete for structs and functions from OS X headers

QT Creator autocomplete for structs and functions from OS X headers

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 827 Views
  • 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.
  • A Offline
    A Offline
    axels
    wrote on last edited by
    #1

    Hello,

    I'm using Qt Creator 3.3 to develop my Qt based applications on OS X Yosemite. Syntax highlighting and autocompletion works well for std c++ an Qt but not for structs and functions from OS X headers.

    It look like that Qt Creator can't find these headers. I.e. the statement #include <CoreAudio/CoreAudio.h> is underlined (means not found). Compiling and linking works fine (Framework is included in project file: LIBS += -framework CoreAudio). Is there any way to tell Qt Creator how to find OS X headers?

    Thanks for help
    Axel

    1 Reply Last reply
    0
    • A Offline
      A Offline
      axels
      wrote on last edited by
      #2

      Hello,

      after a long search I found an unsatisfactory solution.
      The directories in which the headers of the SDK lie have a peculiar structure. It's a mystery for me that the compiler find these header files.

      My Solution:
      I've written a small php shell script. It creates a directory with symbolic links to all header directorys of the SDK frameworks.

      @
      <?php

      $sdk = "MacOSX10.10.sdk";
      $sdk_dir = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/".$sdk."/System/Library/Frameworks/";
      $out_dir = "~/include_".$sdk;

      if(!is_dir($out_dir))
      {
      mkdir($out_dir);
      }

      $d = dir($sdk_dir);
      while( FALSE !== ($f = $d->read()) )
      {
      if( !is_dir($sdk_dir.$f) )
      continue;
      if( ".framework" != substr($f,-strlen(".framework")))
      continue;
      if( is_dir($sdk_dir.$f."/Headers") )
      symlink( $sdk_dir.$f."/Headers", $out_dir."/".substr($f,0,-strlen(".framework")));
      }
      @

      In my .pro file I add this directory to the INCLUDEPATH variable.

      In this way Qt-Creator finds what it needs!

      The disadvantage is. The compiler is disturbed by this INCLUDEPATH, so I always have to remove this entry before compiling.

      Maybe someone knows a better solution?

      Thanks
      Axel

      1 Reply Last reply
      0

      • Login

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