Sublime Forum

Linter for C++ not working for me

#1

I’ve added linter through package control but it isn’t working. I have installed cppcheck from source forge and restarted my system. I see this in the console.

Writing file /M/dmccracken.sbx2/orca/cpx/lib/src/TEST/CpxSipTrunkGroupUnitTest.cpp with encoding UTF-8
Traceback (most recent call last):
File “.\sublime_plugin.py”, line 190, in on_post_save
File “.\sublime_plugin.py”, line 154, in run_timed_function
File “.\sublime_plugin.py”, line 189, in
File “.\SublimeLinter.py”, line 745, in on_post_save
File “.\SublimeLinter.py”, line 364, in select_linter
KeyError: u’c’

Any ideas what I’m doing wrong?

-Dennis-

0 Likes

#2

Ok, I’ve been messing with this all week and still haven’t gotten anywhere. I’ve tried installing both cppcheck and cpplint.py without success.

"sublimelinter_executable_map":
{
    "c_cpplint": "/c/php/cpplint.py"
},
"sublimelinter_syntax_map":
{
    "Python Django": "python",
    "Ruby on Rails": "ruby",
    "C++": "c_cpplint",
    "C": "c_cpplint"
},

I put cpplint.py into php because that folder is in my path. Still no dice.

Traceback (most recent call last):
File “.\sublime_plugin.py”, line 195, in on_modified
File “.\sublime_plugin.py”, line 154, in run_timed_function
File “.\sublime_plugin.py”, line 194, in
File “.\SublimeLinter.py”, line 720, in on_modified
File “.\SublimeLinter.py”, line 364, in select_linter
KeyError: u’c_cpplint’

Is there a way to get more debug info out of SublimeLinter.py here?

-Dennis-

0 Likes