0

I want to build a simple text editor using C++ and Gtk+ in Sublime Text 3. Using Gtk+ for a cross-platform application. For now I'll be satisfied with a simple window, though ST3 keeping popping problems.

I'm currently running Windows 7 64Bits.

At first I downloaded the gtk+-bundle_3.10.4 64bit to C:\gtk+ and downloaded MinGW - installing gcc-g++ for C++ .

Then I updated Environment Variables -PATH with the folder C:/MinGW/bin;C:/gtk+/bin;... and other paths, as suggested Here.

Now to "build system" in ST3, I did as suggested Here. I ran the script (pkg-config..) getting a "linker" and a "header", combining them as you can see in the code below (like suggested here) trying to write it into ST3, but all I got is "no build system".

As you can see by now - I'm lost, please help me with it, I'm pretty sure I'm missing something.

Here is the code I wrote inside ST3 "build system":

{
"cmd": ["g++", "-o" "${file_path}/${file_base_name}.exe" "-static-libgcc" "-static-libstdc++" "*.cpp"
        "-mms-bitfields -
            IC:/gtk+/include/gtk-3.0 -
            IC:/gtk+/include/cairo -
            IC:/gtk+/include/pango-1.0 -
            IC:/gtk+/include/atk-1.0 -
            IC:/gtk+/include/cairo -
            IC:/gtk+/include/pixman-1 -
            IC:/gtk+/include -I/srv/win32builder/fixed_3104/build/win64/include/freetype2 -I/srv/win32builder/fixed_3104/build/win64/include/libxml2 -
            IC:/gtk+/include/libxml2 -I/srv/win32builder/fixed_3104/build/win64/include/freetype2 -
            IC:/gtk+/include/libpng16 -
            IC:/gtk+/include/gdk-pixbuf-2.0 -
            IC:/gtk+/include/libpng16 -
            IC:/gtk+/include/glib-2.0 -
            IC:/gtk+/lib/glib-2.0/include -
            LC:/gtk+/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 
            -lglib-2.0 -lintl -mwindows"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.cpp, source.c++",
"path": "C:/MinGW/bin;C:/gtk+/bin;C:/gtk/include/gtk-3.0/gtk;C:/gtk+/include/gtk-3.0/gdk",
"shell": true,
"variants": [
    {
        "name": "Run",
        "cmd": ["g++", "-o" "${file_path}/${file_base_name}.exe" "-static-libgcc" "-static-libstdc++" "*.cpp" "&" "${file_path}/${file_base_name}.exe"
        "-mms-bitfields -
            IC:/gtk+/include/gtk-3.0 -
            IC:/gtk+/include/cairo -
            IC:/gtk+/include/pango-1.0 -
            IC:/gtk+/include/atk-1.0 -
            IC:/gtk+/include/cairo -
            IC:/gtk+/include/pixman-1 -
            IC:/gtk+/include -I/srv/win32builder/fixed_3104/build/win64/include/freetype2 -I/srv/win32builder/fixed_3104/build/win64/include/libxml2 -
            IC:/gtk+/include/libxml2 -I/srv/win32builder/fixed_3104/build/win64/include/freetype2 -
            IC:/gtk+/include/libpng16 -
            IC:/gtk+/include/gdk-pixbuf-2.0 -
            IC:/gtk+/include/libpng16 -
            IC:/gtk+/include/glib-2.0 -
            IC:/gtk+/lib/glib-2.0/include -
            LC:/gtk+/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 
            -lglib-2.0 -lintl -mwindows"]
    }
]

}

It's a combination of a working build system only for C++ and the script that I got.

Thank you :)

Community
  • 1
  • 1
Daniyel.Me
  • 436
  • 2
  • 8
  • 1
    Why don't you use a Makefile? Then your build system call would simply be `"make"`, and you wouldn't have to edit the build system every time you wanted to change a parameter. – MattDMo Aug 16 '16 at 18:44
  • @MattDMo thank you for your response. I've learned about "MakeFile" and there is two things I'm having trouble with. The thing is, I need gcc-g++ compiler for the C++, and I need also the Gtk+ compiler for the API. First, how does 'Make' supposed to do it? and Second, how can I write the 'make' well, when the code above doesn't work. – Daniyel.Me Aug 17 '16 at 12:03
  • Please open a new question after searching Google and SO for help. – MattDMo Aug 17 '16 at 16:11
  • believe me when I say, I'm searching for more than 20 hours and trying all sorts of things, nothings seems to get the job done. I'll post a new question as you suggest, if you think this post does not point out the problem . – Daniyel.Me Aug 17 '16 at 18:51
  • Part of your problem is that what you've posted above is not valid JSON, so if that's actually indicative of what you're trying to use, that's one reason it doesn't work. However, as MattDMo suggests, use a Makefile for this. – OdatNurd Aug 17 '16 at 21:36

0 Answers0