Why do I get the compile error, “make_managed” is not a member of 'Gtk'?












1















I'm trying to reproduce the example at - https://developer.gnome.org/gtkmm-tutorial/stable/sec-treeview-examples.html.en#treeview-dnd-example



Compile time error:




"make_managed" is not a member of 'Gtk' in the file
treeview_withpopup.cc at the line auto item =
Gtk::make_managed("_Edit", true);




The Netbeans IDE too shows an error at the same line




"Unable to resolve the identifier make_managed"




I've copied the code from the site and gtkmm.h is included in the header file.



I did not find any such question been asked on Stackoverflow yet!
Why am I receiving this compile error?



Please help.










share|improve this question

























  • Welcome to Stack Overflow. Please read the help pages, take the SO tour, read about how to ask good questions, as well as this question checklist. Lastly learn how to create a Minimal, Complete, and Verifiable Example.

    – Some programmer dude
    Nov 16 '18 at 9:26






  • 1





    Please ensure the gtkmm.h you are including pertains to gtkmm3 and accidently not gtkmm2

    – nitinr708
    Nov 16 '18 at 9:41











  • what is version of your gtkmm? try pkg-config --modversion gtkmm-3.0 In older version of gtkmm Gtk::make_managed is not there. It is added recently.

    – Manthan Tilva
    Nov 16 '18 at 9:56











  • I'm usig gtkmm3-3.18.1 and compiling with pkg-config gtkmm-3.0 --cflags --libs

    – PBNeves
    Nov 16 '18 at 10:05
















1















I'm trying to reproduce the example at - https://developer.gnome.org/gtkmm-tutorial/stable/sec-treeview-examples.html.en#treeview-dnd-example



Compile time error:




"make_managed" is not a member of 'Gtk' in the file
treeview_withpopup.cc at the line auto item =
Gtk::make_managed("_Edit", true);




The Netbeans IDE too shows an error at the same line




"Unable to resolve the identifier make_managed"




I've copied the code from the site and gtkmm.h is included in the header file.



I did not find any such question been asked on Stackoverflow yet!
Why am I receiving this compile error?



Please help.










share|improve this question

























  • Welcome to Stack Overflow. Please read the help pages, take the SO tour, read about how to ask good questions, as well as this question checklist. Lastly learn how to create a Minimal, Complete, and Verifiable Example.

    – Some programmer dude
    Nov 16 '18 at 9:26






  • 1





    Please ensure the gtkmm.h you are including pertains to gtkmm3 and accidently not gtkmm2

    – nitinr708
    Nov 16 '18 at 9:41











  • what is version of your gtkmm? try pkg-config --modversion gtkmm-3.0 In older version of gtkmm Gtk::make_managed is not there. It is added recently.

    – Manthan Tilva
    Nov 16 '18 at 9:56











  • I'm usig gtkmm3-3.18.1 and compiling with pkg-config gtkmm-3.0 --cflags --libs

    – PBNeves
    Nov 16 '18 at 10:05














1












1








1








I'm trying to reproduce the example at - https://developer.gnome.org/gtkmm-tutorial/stable/sec-treeview-examples.html.en#treeview-dnd-example



Compile time error:




"make_managed" is not a member of 'Gtk' in the file
treeview_withpopup.cc at the line auto item =
Gtk::make_managed("_Edit", true);




The Netbeans IDE too shows an error at the same line




"Unable to resolve the identifier make_managed"




I've copied the code from the site and gtkmm.h is included in the header file.



I did not find any such question been asked on Stackoverflow yet!
Why am I receiving this compile error?



Please help.










share|improve this question
















I'm trying to reproduce the example at - https://developer.gnome.org/gtkmm-tutorial/stable/sec-treeview-examples.html.en#treeview-dnd-example



Compile time error:




"make_managed" is not a member of 'Gtk' in the file
treeview_withpopup.cc at the line auto item =
Gtk::make_managed("_Edit", true);




The Netbeans IDE too shows an error at the same line




"Unable to resolve the identifier make_managed"




I've copied the code from the site and gtkmm.h is included in the header file.



I did not find any such question been asked on Stackoverflow yet!
Why am I receiving this compile error?



Please help.







c++ compiler-errors gtkmm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 10:43









nitinr708

80311524




80311524










asked Nov 16 '18 at 9:23









PBNevesPBNeves

62




62













  • Welcome to Stack Overflow. Please read the help pages, take the SO tour, read about how to ask good questions, as well as this question checklist. Lastly learn how to create a Minimal, Complete, and Verifiable Example.

    – Some programmer dude
    Nov 16 '18 at 9:26






  • 1





    Please ensure the gtkmm.h you are including pertains to gtkmm3 and accidently not gtkmm2

    – nitinr708
    Nov 16 '18 at 9:41











  • what is version of your gtkmm? try pkg-config --modversion gtkmm-3.0 In older version of gtkmm Gtk::make_managed is not there. It is added recently.

    – Manthan Tilva
    Nov 16 '18 at 9:56











  • I'm usig gtkmm3-3.18.1 and compiling with pkg-config gtkmm-3.0 --cflags --libs

    – PBNeves
    Nov 16 '18 at 10:05



















  • Welcome to Stack Overflow. Please read the help pages, take the SO tour, read about how to ask good questions, as well as this question checklist. Lastly learn how to create a Minimal, Complete, and Verifiable Example.

    – Some programmer dude
    Nov 16 '18 at 9:26






  • 1





    Please ensure the gtkmm.h you are including pertains to gtkmm3 and accidently not gtkmm2

    – nitinr708
    Nov 16 '18 at 9:41











  • what is version of your gtkmm? try pkg-config --modversion gtkmm-3.0 In older version of gtkmm Gtk::make_managed is not there. It is added recently.

    – Manthan Tilva
    Nov 16 '18 at 9:56











  • I'm usig gtkmm3-3.18.1 and compiling with pkg-config gtkmm-3.0 --cflags --libs

    – PBNeves
    Nov 16 '18 at 10:05

















Welcome to Stack Overflow. Please read the help pages, take the SO tour, read about how to ask good questions, as well as this question checklist. Lastly learn how to create a Minimal, Complete, and Verifiable Example.

– Some programmer dude
Nov 16 '18 at 9:26





Welcome to Stack Overflow. Please read the help pages, take the SO tour, read about how to ask good questions, as well as this question checklist. Lastly learn how to create a Minimal, Complete, and Verifiable Example.

– Some programmer dude
Nov 16 '18 at 9:26




1




1





Please ensure the gtkmm.h you are including pertains to gtkmm3 and accidently not gtkmm2

– nitinr708
Nov 16 '18 at 9:41





Please ensure the gtkmm.h you are including pertains to gtkmm3 and accidently not gtkmm2

– nitinr708
Nov 16 '18 at 9:41













what is version of your gtkmm? try pkg-config --modversion gtkmm-3.0 In older version of gtkmm Gtk::make_managed is not there. It is added recently.

– Manthan Tilva
Nov 16 '18 at 9:56





what is version of your gtkmm? try pkg-config --modversion gtkmm-3.0 In older version of gtkmm Gtk::make_managed is not there. It is added recently.

– Manthan Tilva
Nov 16 '18 at 9:56













I'm usig gtkmm3-3.18.1 and compiling with pkg-config gtkmm-3.0 --cflags --libs

– PBNeves
Nov 16 '18 at 10:05





I'm usig gtkmm3-3.18.1 and compiling with pkg-config gtkmm-3.0 --cflags --libs

– PBNeves
Nov 16 '18 at 10:05












2 Answers
2






active

oldest

votes


















1














Gtk::make_managed is defined in gtkmm-3.0/gtkmm/object.h (see this link).



I already got the same error. Then I checked file object.h but there is no make_managed function. I don't know why. I just installed from rpm packge (I used the OS Fedora 23).



My solution:



I add code of make_managed in /usr/include/gtkmm-3.0/gtkmm/object:



template<class T, class... T_Args>
auto make_managed(T_Args&&... args)
{
return manage(new T(std::forward<T_Args>(args)...));
}





share|improve this answer

































    0















    The answer provided by @GAVD and edited by @Ayxan is correct.



    Place the object.h file linked by the that answer in the directory with your source code.




    Add an #include "object.h" before the other #include <gtkmm-whatevers>.

    The make_managed function should resolve. Make sure that you remove this temporary fix when an updated version of gtkmm is fixes the problem permanently.



    Or follow your local procedures to update /usr/include/gtkmm-3.0/gtkmm/object.h



    I found that I also had to add the compiler flag -std=c++14 or -std=gnu++14 because of the way the make_managed function uses type auto. Adding the compiler flag changes the expected C++ language level from the default to the 2014 standard.






    share|improve this answer


























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53334845%2fwhy-do-i-get-the-compile-error-make-managed-is-not-a-member-of-gtk%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Gtk::make_managed is defined in gtkmm-3.0/gtkmm/object.h (see this link).



      I already got the same error. Then I checked file object.h but there is no make_managed function. I don't know why. I just installed from rpm packge (I used the OS Fedora 23).



      My solution:



      I add code of make_managed in /usr/include/gtkmm-3.0/gtkmm/object:



      template<class T, class... T_Args>
      auto make_managed(T_Args&&... args)
      {
      return manage(new T(std::forward<T_Args>(args)...));
      }





      share|improve this answer






























        1














        Gtk::make_managed is defined in gtkmm-3.0/gtkmm/object.h (see this link).



        I already got the same error. Then I checked file object.h but there is no make_managed function. I don't know why. I just installed from rpm packge (I used the OS Fedora 23).



        My solution:



        I add code of make_managed in /usr/include/gtkmm-3.0/gtkmm/object:



        template<class T, class... T_Args>
        auto make_managed(T_Args&&... args)
        {
        return manage(new T(std::forward<T_Args>(args)...));
        }





        share|improve this answer




























          1












          1








          1







          Gtk::make_managed is defined in gtkmm-3.0/gtkmm/object.h (see this link).



          I already got the same error. Then I checked file object.h but there is no make_managed function. I don't know why. I just installed from rpm packge (I used the OS Fedora 23).



          My solution:



          I add code of make_managed in /usr/include/gtkmm-3.0/gtkmm/object:



          template<class T, class... T_Args>
          auto make_managed(T_Args&&... args)
          {
          return manage(new T(std::forward<T_Args>(args)...));
          }





          share|improve this answer















          Gtk::make_managed is defined in gtkmm-3.0/gtkmm/object.h (see this link).



          I already got the same error. Then I checked file object.h but there is no make_managed function. I don't know why. I just installed from rpm packge (I used the OS Fedora 23).



          My solution:



          I add code of make_managed in /usr/include/gtkmm-3.0/gtkmm/object:



          template<class T, class... T_Args>
          auto make_managed(T_Args&&... args)
          {
          return manage(new T(std::forward<T_Args>(args)...));
          }






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 9 at 20:45









          Ayxan

          2,244621




          2,244621










          answered Dec 25 '18 at 12:59









          GAVDGAVD

          1,10011127




          1,10011127

























              0















              The answer provided by @GAVD and edited by @Ayxan is correct.



              Place the object.h file linked by the that answer in the directory with your source code.




              Add an #include "object.h" before the other #include <gtkmm-whatevers>.

              The make_managed function should resolve. Make sure that you remove this temporary fix when an updated version of gtkmm is fixes the problem permanently.



              Or follow your local procedures to update /usr/include/gtkmm-3.0/gtkmm/object.h



              I found that I also had to add the compiler flag -std=c++14 or -std=gnu++14 because of the way the make_managed function uses type auto. Adding the compiler flag changes the expected C++ language level from the default to the 2014 standard.






              share|improve this answer






























                0















                The answer provided by @GAVD and edited by @Ayxan is correct.



                Place the object.h file linked by the that answer in the directory with your source code.




                Add an #include "object.h" before the other #include <gtkmm-whatevers>.

                The make_managed function should resolve. Make sure that you remove this temporary fix when an updated version of gtkmm is fixes the problem permanently.



                Or follow your local procedures to update /usr/include/gtkmm-3.0/gtkmm/object.h



                I found that I also had to add the compiler flag -std=c++14 or -std=gnu++14 because of the way the make_managed function uses type auto. Adding the compiler flag changes the expected C++ language level from the default to the 2014 standard.






                share|improve this answer




























                  0












                  0








                  0








                  The answer provided by @GAVD and edited by @Ayxan is correct.



                  Place the object.h file linked by the that answer in the directory with your source code.




                  Add an #include "object.h" before the other #include <gtkmm-whatevers>.

                  The make_managed function should resolve. Make sure that you remove this temporary fix when an updated version of gtkmm is fixes the problem permanently.



                  Or follow your local procedures to update /usr/include/gtkmm-3.0/gtkmm/object.h



                  I found that I also had to add the compiler flag -std=c++14 or -std=gnu++14 because of the way the make_managed function uses type auto. Adding the compiler flag changes the expected C++ language level from the default to the 2014 standard.






                  share|improve this answer
















                  The answer provided by @GAVD and edited by @Ayxan is correct.



                  Place the object.h file linked by the that answer in the directory with your source code.




                  Add an #include "object.h" before the other #include <gtkmm-whatevers>.

                  The make_managed function should resolve. Make sure that you remove this temporary fix when an updated version of gtkmm is fixes the problem permanently.



                  Or follow your local procedures to update /usr/include/gtkmm-3.0/gtkmm/object.h



                  I found that I also had to add the compiler flag -std=c++14 or -std=gnu++14 because of the way the make_managed function uses type auto. Adding the compiler flag changes the expected C++ language level from the default to the 2014 standard.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 19 at 16:09

























                  answered Feb 18 at 19:20









                  cbcalvincbcalvin

                  1112




                  1112






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53334845%2fwhy-do-i-get-the-compile-error-make-managed-is-not-a-member-of-gtk%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Florida Star v. B. J. F.

                      Danny Elfman

                      Lugert, Oklahoma