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. Using QBS and precompiled headers
Qt 6.11 is out! See what's new in the release blog

Using QBS and precompiled headers

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 809 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.
  • B Offline
    B Offline
    boleslaw
    wrote on last edited by
    #1

    Hi All,

    I am trying to use pre-compiled headers within QBS project. However I have been hit by the issue that my project does not compile within my specific configuration. I am using VS2015.

    I am getting this error during compilation:

    macro.h:5: error: C2006: '#include': expected a filename, found 'identifier'
    

    Same configuration on VS project result in valid compilation, which makes me think that I am either not using the pre-compiled headers feature in QBS correctly or there is a bug with it. I was trying to find some samples to figure it out but no luck so far.

    I am attaching the sample project for reference.

    include_macro_test.qbs

    import qbs
    
    CppApplication {
        consoleApplication: true
    	files: [
            "macro_def.h",
            "main.cpp",
        ]
    
        Group {
            name: "pch"
            fileTags: "cpp_pch_src"
            files: "macro.h"
        }
    
        cpp.useCxxPrecompiledHeader: true
    
        Group {     // Properties for the produced executable
            fileTagsFilter: product.type
            qbs.install: true
        }
    }
    

    main.cpp

    #include "macro.h"
    
    int main()
    {
        printf("test");
    }
    

    macro.h

    #pragma once
    
    #include "macro_def.h"
    
    #include STDIO
    

    macro_def.h

    #pragma once
    
    #define STDIO <stdio.h>
    

    Thanks,
    Boleslaw

    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