I've trying to compile a simple gtkmm program with Sublime Text, but the default C++ build system does not work as it doesn't point to the gtkmm library folder:
fatal error: gtkmm.h: No such file or directory
However, after customizing C++.sublime-build
and changing the "cmd" line to:
"cmd": ["g++", "$file", "-o", "$file_base_name `pkg-config gtkmm-3.0 --cflags --libs`"],
I get the error:
g++: error: `pkg-config gtkmm-3.0 --cflags --libs`: No such file or directory
Apparently ST2 is not running the pkg-config
command prior to g++
, which the back quotes usually do in the command shell. How do I force ST2 to do just that, in order to correctly include gtkmm folder?
I found the "sublime-build" code some days ago on the stackoverflow, but I can't find it again, so I am attaching the .sublime-build file that works for me.
{
"cmd": ["g++ -o ${file_base_name} ${file} `pkg-config --libs --cflags gtk+-3.0` && ./${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"shell":true
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.