Sublime Forum

SublimeClang Win7 x64 Doesn't find includes

#1

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.

[code]#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;

}[/code]

Compiles with

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]{
“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++":
    
    ]
}

}[/code]

And my project file:

[code]{
“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"
]

}
[/code]

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

0 Likes

#2

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]{
“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++":
		
		]
	}
}

}
[/code]

0 Likes