Home Download Buy Blog Forum Support

SublimeClang Win7 x64 Doesn't find includes

SublimeClang Win7 x64 Doesn't find includes

Postby Silberling on Mon Mar 25, 2013 1:41 pm

Hi.
I am pretty new to sublime and currently heavily testing it.
Mostly I am developing C++ so I installed SublimeClang. It works pretty good with simple single files but not with my Sublime Project.

C:\Users\Silberling\Projects\Sublime Text 2\Test\Source\main.cpp:1,10 - Fatal - 'config.hpp' file not found


Code: Select all
#include <config.hpp>

#include <stdlib.h>
#include <stdio.h>

#include <MyClass.hpp>

int main(int argc, char const *argv[])
{
   printf("Hi, this is %s, starting up!\n", PROJECT_NAME);

   MyClass *m = new MyClass(10);

   delete m;

   return EXIT_SUCCESS;
}


Compiles with
-I[PROJECTPATH]/Include

because of the project directory structure:
  • /
  • /Include
  • /Source
  • /Resource

Everything is compiled with a CMake & MSYS Makefile using TDM GCC 4.7.1 64bit.


My current SublimeClang configuration is:
Code: Select all
{
    "dont_prepend_clang_includes": true,
    "options":
    [
        "-Wall",
        "-Wno-missing-braces",
        "-Wno-missing-field-initializers",
        "-Wno-unknown-pragmas",
        "-Wno-unneeded-internal-declaration",
        "-ferror-limit=0",
        "-fdelayed-template-parsing",
        "-Wno-deprecated-declarations",

        "-isystem", "C:\\MinGW\\lib\\gcc\\x86_64-w64-mingw32\\4.7.1\\include",
        "-isystem", "C:\\MinGW\\lib\\gcc\\x86_64-w64-mingw32\\4.7.1\\include\\c++",
        "-isystem", "C:\\MinGW\\lib\\gcc\\x86_64-w64-mingw32\\4.7.1\\include\\c++\\x86_64-w64-mingw32",
        "-isystem", "C:\\MinGW\\x86_64-w64-mingw32\\include",
        "-isystem", "C:\\MinGW\\include"
    ],
    "additional_language_options":
    {
        // For example, you can use "c++": ["-std=c++11"] to enable C++11 features.
        "c++" :
        [
            "-std=gnu++11"
        ],
        "c": [
            "-std=gnu11"
        ],
        "objc":
        [
        ],
        "objc++":
        [
        ]
    }
}


And my project file:
Code: Select all
{
   "folders":
   [
      {
         "path": "/C/Users/Silberling/Projects/Sublime Text 2/Test",
         "folder_exclude_patterns": ["CMakeFiles", "Binary"],
         "file_exclude_patterns": ["cmake_install.cmake", "CMakeCache.txt", "Makefile", "*.sublime-*", ".gitignore"]
      }
   ],
   "sublimeclang_options":
    [
        "-m64",
        "-I${folder:${project_path:Test.sublime-project}}\\Include",
        "-IC:\\Users\\Silberling\\Projects\\Sublime Text 2\\Test\\Include"
    ]
}


AS you can see in the sublimeclang_options section I tried to specify the path absolutely and with variables as shown in the SublimeClang configuration.

I also tried encapsulating the path in double-quotes and escaping the spaces if that would be the problem.

After about 2 hours of searching I am pretty frustrated and now I am here and search for help.

Thanks for reading and replying. If you have any further questions or need more information to help me, please ask.

Silberling
Silberling
 
Posts: 16
Joined: Mon Mar 25, 2013 1:30 pm

Re: SublimeClang Win7 x64 Doesn't find includes

Postby Silberling on Thu Mar 28, 2013 10:11 pm

Ok guys, you just could have told me that i am blind ^^.

I overread that I have to have a "settings" object in my project-settings. THAT object contains the array of options passed to clang.

Additionally, i found out that it has a debug option that, once enabled, pushes the command line parameters to the sublime console.

And that the project-settings override the sections in the default and userconfig of SublimeClang.

So my user-configuration file is now empty and the project settings look like the following code:
Code: Select all
{
   "folders":
   [
      {
         "path": "/C/Users/Silberling/Projects/Sublime Text 2/Test",
         "folder_exclude_patterns": ["CMakeFiles", "Binary"],
         "file_exclude_patterns": ["cmake_install.cmake", "CMakeCache.txt", "Makefile", "*.sublime-*", ".gitignore"]
      }
   ],
   "settings":
   {
      "sublimeclang_dont_prepend_clang_includes": true,
      "sublimeclang_debug_options": false,
      "sublimeclang_options":
      [
         "-Wall",
         "-Wno-missing-braces",
         "-Wno-missing-field-initializers",
         "-Wno-unknown-pragmas",
         "-Wno-unneeded-internal-declaration",
         "-ferror-limit=0",
         "-fdelayed-template-parsing",
         "-Wno-deprecated-declarations",

         "-isystem", "C:\\MinGW\\lib\\gcc\\x86_64-w64-mingw32\\4.7.1\\include",
         "-isystem", "C:\\MinGW\\lib\\gcc\\x86_64-w64-mingw32\\4.7.1\\include\\c++",
         "-isystem", "C:\\MinGW\\lib\\gcc\\x86_64-w64-mingw32\\4.7.1\\include\\c++\\x86_64-w64-mingw32",
         "-isystem", "C:\\MinGW\\x86_64-w64-mingw32\\include",
         "-isystem", "C:\\MinGW\\include",

         "-m64",
         "-I${folder:${project_path:Test.sublime-project}}/Include"
      ],
      "sublimeclang_additional_language_options":
      {
         // For example, you can use "c++": ["-std=c++11"] to enable C++11 features.
         "c++" :
         [
            "-std=gnu++11"
         ],
         "c": [
            "-std=gnu11"
         ],
         "objc":
         [
         ],
         "objc++":
         [
         ]
      }
   }
}
Silberling
 
Posts: 16
Joined: Mon Mar 25, 2013 1:30 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 20 guests