Entries Tagged as ''

More on starting with code::blocks wxformbuilder in linux

Yesterday, I was playing with code::blocks on a xp machine with a gnu compiler (at my mothers house on my sister computer).  Today I’m trying it on my Linux box.  My Linux box has  a older process with a sucky monitor.  Yikes what a difference…

For some reason I’m thinking I want to run wxformbuilder with code::blocks.   I’m trying to determine if there is a plugin for it.
If found a interesting link from 2005:http://forums.codeblocks.org/index.php?topic=193.msg19430

I guess there is no direct plugin for wxformbuilder even though the code::block gui makes reference to it.. Anyway this is the best link I could find that I think describes the situation so far.
http://forums.codeblocks.org/index.php?topic=8868.0

Ok,,, Now this is embarrassing.  I’m trying to remember how to upload an image to my website..
I now I have a SSH connection all setup.. Just how to find the darn thing… Just can’t remember how I did it… Doh… Spent a lot of time trying to figure out I had it in places=> Book Marks.
So… I just joined the codeblocks forum and appended to the above post.  I guess well see what happens…
Ok I think I’m going to switch from this tutorial now from  http://wiki.codeblocks.org/index.php?title=WxSmith_tutorial:_Hello_world

to:
http://wiki.wxformbuilder.org/Tutorials/UsingWxFormBuilder

Ok…. Now hold the phone… Apparently, when I went through the code::blocks new projects wizard  wxformbuilder was one of the default options I picked.  It looks like it opened up  some kind of file called WxWizFrame.fbp.  I guess I should open that up and work within that.
This is what it looks like:

At this point, all I want to do is to figure out how to make the VB6 equivalent of creating a command box and having generate a message box of hello world msgbox…. How hard can that be??

Ok… So now I added a wxStaticBoxSizer to the frame and I added a wxButton along with the stuff necessary to do something on a click event.
I saved and generated the code.  I guess I need to generate the inherited classes now…
From wxformbuilder: Tool=>Generate Inherited Class
This is the what popped up.

So I clicked on GuiFrame and pressed OK, Hmmm Nothing bad seemed to happen.

Alrighty… I want to see if I can compile the project through the code::block IDE know and see what happens..
In Code::Blocks I select Build…  Nothing bad seemed to happen.
Now Code::Blocks I hit Run

Hot darn… This was not too bad..

Ok… At this point I don’t have anything in the say say Hi widget.
But… It looks like help generates a msgbox of sorts.  I need to study all this a bit and figure out how to add that Little bit to the code.  Then I need to see what happens if I add another wxwidget and generate inherited classes…  So far this doesn’t seem too bad..

Code::Blocks Wxwidgets and XP

Ok… So it’s the day after Thanksgiving…
My family went to the Strongbow Inn in Indiana, and are jaws dropped when we got the bill.
It was one of those situations where the food was nice, but it wasn’t that nice.
Let me put it to you this way, if we would have cooked at home and invested what it cost us, we would have had leftovers for a month..
Next year we’re having Thanksgiving at my house. I wonder how many people will do the same after that wallet lightener.. Prefer Thanksgiving at home anyway…

I’m experimenting with code blocks on a XP machine at the moment.
I hind site, I wish I documented everything I did up to this point.
I downloaded, wxwidgets, code::builder, wxformbuilder and somewhere along the way gcc was included in one of the packages.
Somehow I reached a decision to use wxformbuilder over Glade, but I appears that wxsmith seems is native to code::blocks. It doesn’t appear a big deal to go over to wxformbuilder.
I found a hello world example at http://wiki.codeblocks.org/index.php?title=WxSmith_tutorial:_Hello_world

I installed everything and started to go through the step by step tutorial and I sort of hit a snag at this point of the tutorial

When you follow another wizard pages, you may occasionally see message box saying that debug configuration can not be found. This is because the wxWidgets library was build using release mode (the BUILD=release option used for make). If you want real debug library, you can recompile your wxWidgets by using BUILD=debug. Project may also be tuned to work with release version on both debug and release build targets (the way to do this is presented at the end of this tutorial)

I start poking around a bit with this stuff and it appears this is sort of a big deal. Basically, if you don’t know what your doing your going to want to switch this to BUILD=debug.
Perhaps this is a good thing that my progress has gotten slowed a bit here… There are a bunch of questions whose answer are very fuzzy to me. Code::blocks seems to allow multiple compilers. My understand is that pre-compiled libraries across multiple compilers is not a big deal across c applications but is a big headache with C++. Light bulb went off. Is that a reason why Gtk+ is written in c.

Somehow I got myself pointed to this link I need to research: http://www.wxwidgets.org/docs/faqmsw.htm

So… The issue is whether to use gcc or a windows compiler for XP. But…. for now I have help start putting up the christmas tree. :)
The saga continues here

Playing around with wxwidgets, wkformbuilder Code::blocks

I was just reflecting with on the long line of stuff that I’ve looked at prior to getting to this spot.
I’ve looked at QT, gtk, gtkmm and finally wxwidgets.  I’ve glanced at glade and wxwidgets. I’ve played a little bit with Anjuta, Netbeans, Emac’s.
For the first time, I had a  real comfort level from the get go when I went through the wxformbuilder tutorial.  I guess to be truthfull, the comfort level sort of ended at step 10, when it started talking about integrating the generated code into an IDE.    To quote:

Now it is time to integrate the generated code with your IDE (Visual C++, Dev-C++, Code::Blocks…). You will have to add the generated files (tutorial_gui.h/cpp) to the project.

I found a most excellent wiki site which a cross comparison of IDE’s across multiple platforms. But first searching for that I ran into a general discussion about IDE’s

I statement in the above article rings true for me:

However, because an IDE is by its very nature a complicated piece of software, this high productivity only occurs after a long learning time.

Anyway, based on the cross comparison I felt that Code::blocks would suit my needs. I downloaded the PDF for it and it’s massive…. The quote about a complicated piece of software comes to mind. I need to do a little searching for a quick start tutorial…..

Vb6 Gui Programmer at heart working towards cross platform: Wxwidgets

Ok… So I manage to get to Technique 2 in Matthew Telles’s C++ Timesaving Techniques for Dummies.
My Linux GNU compiler is yapping about this and that, sending out warnings about the “gets” that are in the source… (Some details about that in yesterdays post).
Anyway… the author kept the code very simple to demonstrate his points.  The section of code that’s having issues, wants you to provide the file path and name to a text file.  I know this is just an exercise, but darn, this is kind of coding is what I used to do in my dos days with quick basic…  Forget that…….
That’s gets me thinking about my beloved vb6 common dialog command control, where, I can browse and click on what I want.  I’m can almost guarantee that I will never code anything entering a filename and path from a command line.  Yechhhhh.

From discussions I’ve on the Ubuntuforums, in regards to my desire for cross platform programming, it seems like wxWidgets is the tool I’m looking for.  I did a little searching and I think what I’m looking for is something called wxfile or something like that. So…. I took the plunge and downloaded wxWidgets off of synaptic..   I fired up the IDE for the first time, and it feels familiar…   Alright….  So that’s where I’m at.  I’m going to play with this for a while and see if I can build some massive overkill into a very simple example.  Maybe I’m weird, but to me, this is fun.  Ok… I’m just weird.

First step work through the tutorial at http://wiki.wxformbuilder.org/Tutorials/UsingWxFormBuilder

Next step is to load up an IDE.  I chose, code::Blocks IDE.  I had a bunch of issues installing this, but ubuntuforums had the cure..

Working through code and things to avoid.

I’ve been starting to work my way through C++ Timesaving Techniques for Dummies.
I’m a little reluctant to post publically out of respect of copyright.
I’m digesting Technique 2 Using Abrstraction to Extend Functionality and I start getting compiler warnings and the program crashes…
He’s using some C library functions that are allowed but not recommended.
To be fair, he’s trying to keep the code simple to demonstrate abstraction and virtual functions.  The issue appears with the gets command in Linux and g++
Regardless I learned something new insofar as to what not to do…..  It just makes me uneasy studying code that is considered bad practice in C++ while trying to learn C++
I ran across this link that I found interesting.
Things to Avoid in C/C++ — gets() , Part 1

Fun time getting spread thin. Feeling conflicted.

I’ve been finding myself getting squeezed for time lately.   I’ve moved up in the world and went from 2000 to XP at work.   I’ve had orders of magnitudes of performance improvement in the data mining kind of stuff I do, only to find that the scroll button on my mouse apparently won’t work in XP unless I install some patches into my VB6 code@#%.  I really like programming in VB6 mostly because I know it very well.  It’s very comforting  thinking in terms of what you want accomplish versus getting distracted by thinking about how to do it.
So… here I am conflicted.  Needing to learning some more up date language for work in a Microsoft environment and yet being called by the sultry sirens of Linux in my free fun time.  What to do…… Cross platform programming of course.
In the meantime, my teaching myself opencascade project is proceding not as fast as I would like.  I haven’t programmed enough in C++ to really make hay on this.  I have spent a huge amount of time on this project and I know I’ve progressed in my knowlege of Linux, C++, but realistically I’m still at the gates with opencascade.  If feel that if I really want to have fun with Opencascade, I need get more comfortable with C++ with practice.

To that end, I checked out a book “C++ Timesaving Techniques for Dummies” by Matthey Teiles from my local library and downloaded the source from the site.  I tried to just read the book, but frankly I just kept falling asleep when I was browsing it in the evening.  (To be fair, I used to be a night owl but morning kindergarten has changed all that.. I’m usually snoring by 10pm) .  I digress… There are seventy sample projects that, I think it would be good practice to rip through this code with book in hand…  So…. I think I’m going to make that my front burner project.

Now unto my work issues.. I created at thread on ubuntuforums titled Cross Platform Rad Tools

I’ve gotten a lot of interesting feedback and have alot to think about…..
Now…. I spent more time surfing… than looking at code…. Need more action less contemplation… More later…

Looking at Gtkmm support code for Opencascade Makebottle to see what makes it tick.

As a kid, my mom would give me old broken clocks to take apart. She said that it would keep me occupied for hours. I guess this blog is my adult version of the same thing..

I have had a hard time finding basic documentation on how to get a basic window open in Ubuntu Linux to display a opencascade model using Gtk+.
I stumbled on a very basic program using Google code search

I think something is screwed up with this tarball and I wound up cutting and pasting from the Google page.
My installation of opencascade differs from most (I think) since I installed it from a .deb file which put the libraries in a standard location. The consequences of this is that I need to re-write the Makefile to have it point to the appropriate location (see prior post)

I had been experimenting with Automake but, I still  having some issues with it…. So since I have working code at the moment using a Manually configured makefile… that project is on the back-burner for the moment…. Ok…. enough of looking backwards… Time to look forwards.

So the basic task at hand is to try to understand the concepts of what it takes to get a basic opencascade object to display using Gtkmm / C++ in Ubuntu Linux.

I suppose the way to do this is to start with Main.cpp

#include <gtkmm.h>
#include <gtkmmocascade.h>

TopoDS_Shape
MakeBottle(const Standard_Real myWidth , const Standard_Real myHeight , const Standard_Real myThickness);


class Simple : public Gtk::Window
{
public:
  Simple();
  virtual ~Simple();

protected:
  // signal handlers:
  void on_button_quit_clicked();
  void on_button_make_bottle_clicked();
  void on_ocascade_init(GtkOpenCascade3d &data);

protected:

  bool m_isMadeBottle;
  // member widgets:
  Gtk::VBox m_VBox;
  GtkOpenCascade3d m_SimpleGLScene;
  Gtk::Button m_ButtonQuit;
  Gtk::Button m_ButtonMakeBottle;

};

Simple::Simple()
  : m_isMadeBottle(false),m_VBox(false, 0), m_ButtonQuit("Quit"),m_ButtonMakeBottle("Make Bottle")
{
  //
  // Top-level window.
  //

  set_title("Simple");

  // Get automatically redrawn if any of their children changed allocation.
  set_reallocate_redraws(true);

  add(m_VBox);

  //
  // Simple OpenGL scene.
  //

  m_SimpleGLScene.set_size_request(300, 300);

  m_SimpleGLScene.signal_on_init().connect(sigc::mem_fun(*this, &Simple::on_ocascade_init));



  m_VBox.pack_start(m_SimpleGLScene);


  //
  // Simple MakeBottle button.
  //

  m_ButtonMakeBottle.signal_clicked().connect(sigc::mem_fun(*this, &Simple::on_button_make_bottle_clicked));

  m_VBox.pack_start(m_ButtonMakeBottle, Gtk::PACK_SHRINK, 0);

  //
  // Simple quit button.
  //

  m_ButtonQuit.signal_clicked().connect(
    sigc::mem_fun(*this, &Simple::on_button_quit_clicked));

  m_VBox.pack_start(m_ButtonQuit, Gtk::PACK_SHRINK, 0);

  //
  // Show window.
  //


  show_all();

}

Simple::~Simple()
{}

void Simple::on_button_quit_clicked()
{
  Gtk::Main::quit();
}

void Simple::on_button_make_bottle_clicked()
{
  if(m_SimpleGLScene.isInitialized() && ! m_isMadeBottle )
    {
      TopoDS_Shape aBottle=MakeBottle(50,70,30);
      Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);
      m_SimpleGLScene.getContext()->SetMaterial(AISBottle,Graphic3d_NOM_GOLD);
      m_SimpleGLScene.getContext()->SetDisplayMode(AISBottle,1,Standard_False);
      m_SimpleGLScene.getContext()->Display(AISBottle,Standard_False);

      //myContext->SetCurrentObject(AISBottle,Standard_False);

      //myContext->Activate(AISBottle,0);

      m_SimpleGLScene.getView()->FitAll();
      m_SimpleGLScene.getView()->ZFitAll();

      m_isMadeBottle = true;
    }
}


void Simple::on_ocascade_init(GtkOpenCascade3d &data)
{
 TopoDS_Shape aBottle=MakeBottle(50,70,30);
 Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);
 data.getContext()->SetMaterial(AISBottle,Graphic3d_NOM_GOLD);
 data.getContext()->SetDisplayMode(AISBottle,1,Standard_False);
 data.getContext()->Display(AISBottle,Standard_False);

 //myContext->SetCurrentObject(AISBottle,Standard_False);

 //myContext->Activate(AISBottle,0);

 data.getView()->FitAll();
 data.getView()->ZFitAll();
 m_isMadeBottle = true;
}

//
// Main.
//

int main(int argc, char** argv)
{
  Gtk::Main kit(argc, argv);

  //
  // Init gtkglextmm.
  //

  Gtk::GL::init(argc, argv);

  //
  // Instantiate and run the application.
  //

  Simple *simple;

  simple = new Simple;

  kit.run(*simple);

  return 0;
}

So…. What’s going on here…
Alrightly, starting out with main()
This is covered in the Gtkmm manual so no need to go there.

Gtk::Main kit(argc, argv);

Ok.. The next line, may be in the gtkmm manual which I may have not gotten to because I got bored to tears…
I need to research this one to understand.

Gtk::GL::init(argc, argv);

Ok… an interesting code source which I may try a little later on: http://gtkglext.sourceforge.net/reference/gtkglextmm/share-lists_8cc-example.html

I think I may have found a starting point to start:http://www.k-3d.org/gtkglext/Main_Page
Dohhh.. I should look at the comment line about to understand what this does…

//
// Init gtkglextmm.
//

This wiki link pretty much explains it>

gtkglextmm, a C++ wrapper for GtkGLExt, is also available. C++ programmers can use it to write GTK+-based OpenGL applications using gtkmm 2.

I that’s good enough for now…
I need to pick this up a little later on with a edit…
;)
Lets see if I can figure out the next bit.


  Simple *simple;
  simple = new Simple;
  kit.run(*simple);

So… we’re declaring a pointer (simple) to an Class called Simple.
Next line we’re creating and object and assigning its location to the pointer..
After that we’re firing up Gtkmm using the pointer to the object..
Now that all seems very straight forwards..

I guess the next logical step would be to tear apart the class Simple

class Simple : public Gtk::Window
{
public:
Simple();
virtual ~Simple();

protected:
// signal handlers:
void on_button_quit_clicked();
void on_button_make_bottle_clicked();
void on_ocascade_init(GtkOpenCascade3d &data);

protected:

bool m_isMadeBottle;
// member widgets:
Gtk::VBox m_VBox;
GtkOpenCascade3d m_SimpleGLScene;
Gtk::Button m_ButtonQuit;
Gtk::Button m_ButtonMakeBottle;

};

The Class Simple inherits a Gtk::window class… Got that part…
Everything makes more or less sense to be at the moment. I think to have my curiosity satisfied as to how a opencascade object is drawn I need to look at the following:

// signal handlers:
void on_button_quit_clicked();
void on_button_make_bottle_clicked();
void on_ocascade_init(GtkOpenCascade3d &data);

As well as:

// member widgets:
Gtk::VBox m_VBox;
GtkOpenCascade3d m_SimpleGLScene;
Gtk::Button m_ButtonQuit;
Gtk::Button m_ButtonMakeBottle;

I think I need to understand whats going on with GtkOpenCascade3d before looking at on_ocacade_init

gtkmmocascade.h has the class declaration for GtkOpenCascade3d and it looks like this;

#include <gtkmm.h>
#include <gtkglmm.h>

#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif

#include <GL/gl.h>
#include <GL/glu.h>

#include <AIS_InteractiveContext.hxx>

#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>

#include <Geom_BSplineSurface.hxx>

#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_NameOfMaterial.hxx>

#include <TopoDS_Shape.hxx>
#include <AIS_Shape.hxx>

#include <Handle_V3d_OrthographicView.hxx>
#include <Handle_V3d_PerspectiveView.hxx>
#include <V3d_OrthographicView.hxx>
#include <V3d_PerspectiveView.hxx>
#include <Aspect_Handle.hxx>
#include <Handle_AIS_Trihedron.hxx>
#include <AIS_Trihedron.hxx>
#include <Geom_Axis2Placement.hxx>

#ifndef __GTK_MM_OPEN_CASCADE__
#define __GTK_MM_OPEN_CASCADE__

class GtkOpenCascade3d : public Gtk::DrawingArea,
			 public Gtk::GL::Widget<GtkOpenCascade3d>
{
public:

  typedef sigc::signal<void,GtkOpenCascade3d &> type_signal_gtkocascade3d;

  //
  // Signal !
  //

  type_signal_gtkocascade3d signal_on_init(void);

  //
  // Methods
  //

  GtkOpenCascade3d ();
  virtual ~GtkOpenCascade3d ();

  bool isInitialized(void)
    {
      return opencascade_inited;
    }


  Handle(V3d_View) & getView(void)
    {
      return myView;
    }

  Handle(V3d_Viewer) & getViewer(void)
    {
      return myViewer;
    }

  Handle(AIS_InteractiveContext) & getContext(void)
    {
      return myContext;
    }

protected:
  virtual void on_realize();
  virtual bool on_configure_event     (GdkEventConfigure* event);
  virtual bool on_expose_event        (GdkEventExpose* event);
  virtual bool on_motion_notify_event (GdkEventMotion* event);
  virtual bool on_button_press_event  (GdkEventButton* event);
  virtual bool on_button_release_event(GdkEventButton* event);

  type_signal_gtkocascade3d m_signal_on_init;

private:
  Handle(V3d_View)   myView;
  Handle(V3d_Viewer) myViewer;
  Handle(AIS_InteractiveContext) myContext;
  bool opencascade_inited;

  bool is_mouse_button_pressed;

  guint mouse_button_press;


  void opencascade_realize (void);
  void opencascade_init    (void);
};

#endif // __GTK_MM_OPEN_CASCADE__

Time to tear it apart

class GtkOpenCascade3d : public Gtk::DrawingArea,
			 public Gtk::GL::Widget<GtkOpenCascade3d>

This is my first time looking at this stuff.

The inherited “public Gtk::DrawingArea,” seems straightforward enough.  I just need to find a Link to some reference information: http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-drawingarea.html This will take some time to digest.

It appears that gtkmm a while back used gdk but utilizes cairo as well as pango. The former handles graphics and the latter text..

Going through the first 5 or so pages of the tutorial on drawingarea didn’t seem to incite full.  Hopefully, it’ll all come together…
This is a little fuzzy to me at the moment:

public Gtk::GL::Widget<GtkOpenCascade3d>

I found the Gtk::GL::Widget Class Reference

More on taking another crack at putting it all together..

Ok… I think I’m so close to putting it all together. Whether or not it works, well that’s another matter.
Just a note to myself here but for I start.
I added these notes to src/Makefile.am:

AM_CXXFLAGS =-DHAVE_IOSTREAM -DHAVE_LIMITS
AM_CPPFLAGS = -I/usr/include/opencascade/

It seemed to work, but I wonder if they where meant to go in the configure.ac Quick check to my favorite tutorial.. I seem to be using AM_CPPFLAGS correctly, but there is no reference to AM_CXXFLAGS in this tutorial…
Ok… there are references appearing to AM_CXXFLAGS on the net so….. I think I need to did deeper….
This is not what I intended to do this morning but….
I found some interesting info here:http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.htm

27.6.1 Compile Flag Variables

This section attempts to answer all the above questions. We will mostly discuss CPPFLAGS in our examples, but actually the answer holds for all the compile flags used in Automake: CCASFLAGS, CFLAGS, CPPFLAGS, CXXFLAGS, FCFLAGS, FFLAGS, GCJFLAGS, LDFLAGS, LFLAGS, LIBTOOLFLAGS, OBJCFLAGS, RFLAGS, UPCFLAGS, and YFLAGS.

CPPFLAGS, AM_CPPFLAGS, and mumble_CPPFLAGS are three variables that can be used to pass flags to the C preprocessor (actually these variables are also used for other languages like C++ or preprocessed Fortran). CPPFLAGS is the user variable (see User Variables), AM_CPPFLAGS is the Automake variable, and mumble_CPPFLAGS is the variable specific to the mumble target (we call this a per-target variable, see Program and Library Variables).

Ok… I think i found my answer here: 8.4 Program and Library Variables

maude_CCASFLAGS
maude_CFLAGS
maude_CPPFLAGS
maude_CXXFLAGS
maude_FFLAGS
maude_GCJFLAGS
maude_LFLAGS
maude_OBJCFLAGS
maude_RFLAGS
maude_UPCFLAGS
maude_YFLAGS
Automake allows you to set compilation flags on a per-program (or per-library) basis. A single source file can be included in several programs, and it will potentially be compiled with different flags for each program. This works for any language directly supported by Automake. These per-target compilation flags are ‘_CCASFLAGS’, ‘_CFLAGS’, ‘_CPPFLAGS’, ‘_CXXFLAGS’, ‘_FFLAGS’, ‘_GCJFLAGS’, ‘_LFLAGS’, ‘_OBJCFLAGS’, ‘_RFLAGS’, ‘_UPCFLAGS’, and ‘_YFLAGS’.

When using a per-target compilation flag, Automake will choose a different name for the intermediate object files. Ordinarily a file like sample.c will be compiled to produce sample.o. However, if the program’s _CFLAGS variable is set, then the object file will be named, for instance, maude-sample.o. (See also renamed objects.) The use of per-target compilation flags with C sources requires that the macro AM_PROG_CC_C_O be called from configure.ac.

In compilations with per-target flags, the ordinary ‘AM_’ form of the flags variable is not automatically included in the compilation (however, the user form of the variable is included). So for instance, if you want the hypothetical maude compilations to also use the value of AM_CFLAGS, you would need to write:

Oh… I wish I hadn’t run out of coffee yesterday…. tea is just not enough…
This is what my directory looks like.

jonas@Ubuntu4:~/gtkmmocascade/src$ ls
gtkmmocascade.cpp gtkmmocascade-main.o MakeBottle.cpp Makefile.am Makefile.old
gtkmmocascade.h main.cpp Makefile Makefile.in

It make no sense to me, why I put a AM_CXXFLAGS there… (I think I may have gotten it from the OCC_forum…
Ok… I fixed a few things up…
and here’s what happens when I run make:

jonas@Ubuntu4:~/gtkmmocascade$ make
make all-recursive
make[1]: Entering directory `/home/jonas/gtkmmocascade’
Making all in src
make[2]: Entering directory `/home/jonas/gtkmmocascade/src’
make[2]: *** No rule to make target `gtmmocascade.cpp’, needed by `gtkmmocascade-gtmmocascade.o’. Stop.
make[2]: Leaving directory `/home/jonas/gtkmmocascade/src’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jonas/gtkmmocascade’
make: *** [all] Error 2
jonas@Ubuntu4:~/gtkmmocascade$

Ok… This is pretty much what happened before my corrections…
So… googling 668000 hits.. on “*** No rule to make target” that’s comforting at least to I’m not a alone with this issue.  One of the first hits has a good line. “Wo ist der Hund begraben? Where is the dog buried… ;)
(I’m going to use that one)
If found another reference on :http://www.opencascade.org/org/forum/thread_4018/
Hmm… running out of time here… Going to need to look at this at lunch….
So… here is what my src/Makefile.am currently looks like…

LIB_OCC= -Luser/lib -lTKernel -lTKMath -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo \

-lTKPrim -lTKBool -lTKFeat -lTKFillet -lTKOffset -lTKHLR \

-lTKService -lTKV2d -lTKV3d -lTKMesh -lTKPCAF -lTKLCAF -lTKPLCAF -lTKCDF -lTKCAF \

-lPTKernel -lTKIGES -lTKSTEP -lTKSTEPBase -lTKSTEPAttr -lTKSTEP209 -lTKSTL -lTKVRML -lTKShHealing \

-lTKXSBase -lTKPShape -lTKShapeSchema -lTKOpenGl

AM_CPPFLAGS = -I/usr/include/opencascade/ -DHAVE_IOSTREAM -DHAVE_LIMITS
bin_PROGRAMS = gtkmmocascade
gtkmmocascade_SOURCES = gtmmocascade.h main.cpp gtmmocascade.cpp MakeBottle.cpp
gtkmmocascade_CPPFLAGS = $(GTKMM_CFLAGS) $(GTKGLEXTMM_CFLAGS)
gtkmmocascade_LDADD = $(GTKMM_LIBS) $(GTKGLEXTMM_LIBS) $(LIB_OCC)

I ran across a couple interesting links at lunch…
http://www.gamedev.net/community/forums/topic.asp?topic_id=510468
This link also points to a make tutorial that code my eye.. I need to check  this out also…

http://www.hsrl.rutgers.edu/ug/make_help.html

A side note… I ran across a interesting link on cross platform IDE’s
http://www.gamedev.net/community/forums/topic.asp?topic_id=296922

I added these two line to my configure.ac
AC_PROG_LIBTOOL        # add libtool to autotools suite
AC_SUBST(LIBTOOL_DEPS) # force regeneration of libtool  if necessary

I got rid of that error but that gave me some more…

jonas@Ubuntu4:~/gtkmmocascade$
jonas@Ubuntu4:~/gtkmmocascade$ make
make all-recursive
make[1]: Entering directory `/home/jonas/gtkmmocascade’
Making all in src
make[2]: Entering directory `/home/jonas/gtkmmocascade/src’
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/atkmm-1.6 -I/usr/include/gtk-2.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/cairomm-1.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/atk-1.0 -I/usr/include/gtkglextmm-1.2 -I/usr/lib/gtkglextmm-1.2/include -I/usr/include/gtkglext-1.0 -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/lib/gtkglext-1.0/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/cairomm-1.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/atk-1.0 -I/usr/include/atkmm-1.6 -g -O2 -MT gtkmmocascade-main.o -MD -MP -MF “.deps/gtkmmocascade-main.Tpo” -c -o gtkmmocascade-main.o `test -f ‘main.cpp’ || echo ‘./’`main.cpp; \
then mv -f “.deps/gtkmmocascade-main.Tpo” “.deps/gtkmmocascade-main.Po”; else rm -f “.deps/gtkmmocascade-main.Tpo”; exit 1; fi
In file included from main.cpp:2:
./gtkmmocascade.h:12:38: error: AIS_InteractiveContext.hxx: No such file or directory
./gtkmmocascade.h:14:24: error: V3d_View.hxx: No such file or directory
./gtkmmocascade.h:15:26: error: V3d_Viewer.hxx: No such file or directory
./gtkmmocascade.h:17:35: error: Geom_BSplineSurface.hxx: No such file or directory
./gtkmmocascade.h:19:37: error: AIS_InteractiveObject.hxx: No such file or directory
./gtkmmocascade.h:20:40: error: Graphic3d_NameOfMaterial.hxx: No such file or directory

Opp’s I seem to have regressed…

jonas@Ubuntu4:~/gtkmmocascade$ locate AIS_InteractiveContext.hxx
/usr/include/opencascade/AIS_InteractiveContext.hxx

The issue would be with the src/Makefile.am. I make a couple of tweeks. I seems to be back to my orginal issue.
Now…. I’m back this this message

jonas@Ubuntu4:~/gtkmmocascade$ cd src
jonas@Ubuntu4:~/gtkmmocascade/src$ ls
gtkmmocascade.cpp  gtkmmocascade-main.o  MakeBottle.cpp  Makefile.am   Makefile.in
gtkmmocascade.h    main.cpp              Makefile        Makefile.am~  Makefile.old
jonas@Ubuntu4:~/gtkmmocascade/src$ cd ..
jonas@Ubuntu4:~/gtkmmocascade$ make
make  all-recursive
make[1]: Entering directory `/home/jonas/gtkmmocascade’
Making all in src
make[2]: Entering directory `/home/jonas/gtkmmocascade/src’
make[2]: *** No rule to make target `gtmmocascade.cpp’, needed by `gtkmmocascade-gtmmocascade.o’.  Stop.
make[2]: Leaving directory `/home/jonas/gtkmmocascade/src’
make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/jonas/gtkmmocascade’
make: *** [all] Error 2
jonas@Ubuntu4:~/gtkmmocascade$
Man this is frustrating….
Ok… I’m going retrace my steps and think about this…
I download some source from here…http://edwin.iband.net/opencascade/gtkmmocascade.tar.bz2
Some thing was screwed up with the tar ball. I believe I manually extracted each file via google source..
Now the problem the package is with the makefiles. I’m using opencascade from a .deb files where everythings is in a standard location….
I tried doing two things at once, fix the locations and use automake…. I think I’m missing something very very obvious…
Perhaps… I could just try to fix the makefiles with out using automake and see where that gets me…
Ok… Since, my version of opencascade was made from a .deb I needed change the some of the specified locations.
The makefile as downloaded looked like this:
CC=g++

TARGET=makebottle

OBJS= main.o \
MakeBottle.o \
gtkmmocascade.o

GTK_INCLUDES=`pkg-config gtkmm-2.4  gtkglextmm-1.2 –cflags `
GTK_LDFLAGS=`pkg-config  gtkmm-2.4  gtkglextmm-1.2 –libs`

OCC_INCLUDES_OLD=-DCSFDB -DNO_CXX_EXCEPTION -DNo_Exception  \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/opt/OpenCASCADE5.2/ros/inc  \
-I/opt/OpenCASCADE5.2/ros/src/WOKTclLib

OCC_INCLUDES=-DCSFDB \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/opt/OpenCASCADE5.2/ros/inc  \
-I/opt/OpenCASCADE5.2/ros/src/WOKTclLib

OCC_LDFLAGS=-L/opt/OpenCASCADE5.2/ros/Linux/lib

LIB_OCC= -lTKernel -lTKMath -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo \
-lTKPrim -lTKBool -lTKFeat -lTKFillet -lTKOffset -lTKHLR \
-lTKService -lTKV2d -lTKV3d -lTKPCAF -lTKCDF -lTKCAF \
-lPTKernel -lTKIGES -lTKSTEP -lTKSTL -lTKVRML -lTKShHealing \
-lTKXSBase -lTKPShape -lTKShapeSchema -lTKOpenGl  -lTKBO  \
-lTKBool -lTKTopAlgo -lTKPrim -lTKOffset -lTKFillet -lTKBO

CPPFLAGS= -Wno-deprecated -I./ $(GTK_INCLUDES) $(OCC_INCLUDES)
CFLAGS=$(CPPFLAGS)

LDFLAGS=$(GTK_LDFLAGS) $(OCC_LDFLAGS) $(LIB_OCC)

$(TARGET):$(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)

.PHONY: clean distclean

clean:
-rm -f $(OBJS)

distclean:
-rm -f $(TARGET)

.SUFFIXES: .cpp .o

.cpp.o:
$(CC) $(CPPFLAGS) -c $< -o $@

main.o          : main.cpp gtkmmocascade.h
MakeBottle.o    : MakeBottle.cpp
gtkmmocascade.o : gtkmmocascade.cpp gtkmmocascade.h

I had to tweek it to look like this:

CC=g++

TARGET=makebottle

OBJS= main.o \
MakeBottle.o \
gtkmmocascade.o

GTK_INCLUDES=`pkg-config gtkmm-2.4  gtkglextmm-1.2 –cflags `
GTK_LDFLAGS=`pkg-config  gtkmm-2.4  gtkglextmm-1.2 –libs`

OCC_INCLUDES_OLD=-DCSFDB -DNO_CXX_EXCEPTION -DNo_Exception  \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/usr/include/opencascade
#-I/opt/OpenCASCADE5.2/ros/src/WOKTclLib this directory doesn’t exist

OCC_INCLUDES=-DCSFDB \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/usr/include/opencascade
#  \
#             -I/opt/OpenCASCADE5.2/ros/src/WOKTclLib

OCC_LDFLAGS=-L/usr/lib

LIB_OCC= -lTKernel -lTKMath -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo \
-lTKPrim -lTKBool -lTKFeat -lTKFillet -lTKOffset -lTKHLR \
-lTKService -lTKV2d -lTKV3d -lTKPCAF -lTKCDF -lTKCAF \
-lPTKernel -lTKIGES -lTKSTEP -lTKSTL -lTKVRML -lTKShHealing \
-lTKXSBase -lTKPShape -lTKShapeSchema -lTKOpenGl  -lTKBO  \
-lTKBool -lTKTopAlgo -lTKPrim -lTKOffset -lTKFillet -lTKBO

CPPFLAGS= -Wno-deprecated -I./ $(GTK_INCLUDES) $(OCC_INCLUDES)
CFLAGS=$(CPPFLAGS)

LDFLAGS=$(GTK_LDFLAGS) $(OCC_LDFLAGS) $(LIB_OCC)

$(TARGET):$(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)

.PHONY: clean distclean

clean:
-rm -f $(OBJS)

distclean:
-rm -f $(TARGET)

.SUFFIXES: .cpp .o

.cpp.o:
$(CC) $(CPPFLAGS) -c $< -o $@

main.o          : main.cpp gtkmmocascade.h
MakeBottle.o    : MakeBottle.cpp
gtkmmocascade.o : gtkmmocascade.cpp gtkmmocascade.h

This actually worked :)
I actually have an image that I’d like to post here. But for some reason I can’t get it to upload at the moment :(
Hmmm… It seems to be a problem related to Adobe Flash (which I did download a while back…)

http://wordpress.org/support/topic/177127 I’m not in the mood to explore this one for now, so I guess they’ll be no pictures till wordpress 2.7 which is still in beta, comes out.

Taking another crack at putting it all together.

I was on my path of working through the gtkmm tutorial and frankly I got a little bored,
I started to take a look at glade3 which looks like it should take some of the tedium out of all this..

Anyway… A while back, I found a tarball  of a simple application to get a occ makebottle to display.  Off course it didn’t fire up on the get go…  I don’t even know how good the source is.   I had some issues with it probably premature went off for help. I was looking the simplest application possible to run  makebottle.cpp in linux.

I’m not sure my skill sets are yet a level to take on what’s going on here, but I guess I don’t try I won’t get any better.

So, I keep fixing[?] Makefiles.am’s and the Configure.ac this is basically where I got stuck:

jonas@Ubuntu4:~/gtkmmocascade$ make
make  all-recursive
make[1]: Entering directory `/home/jonas/gtkmmocascade’
Making all in src
make[2]: Entering directory `/home/jonas/gtkmmocascade/src’
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/include/opencascade/  -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/atkmm-1.6 -I/usr/include/gtk-2.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/cairomm-1.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/atk-1.0   -I/usr/include/gtkglextmm-1.2 -I/usr/lib/gtkglextmm-1.2/include -I/usr/include/gtkglext-1.0 -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/lib/gtkglext-1.0/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/cairomm-1.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/atk-1.0 -I/usr/include/atkmm-1.6    -DHAVE_IOSTREAM_H -DHAVE_LIMITS_H -DHAVE_IOSTREAM_H -g -O2 -MT gtkmmocascade-main.o -MD -MP -MF “.deps/gtkmmocascade-main.Tpo” -c -o gtkmmocascade-main.o `test -f ‘main.cpp’ || echo ‘./’`main.cpp; \
then mv -f “.deps/gtkmmocascade-main.Tpo” “.deps/gtkmmocascade-main.Po”; else rm -f “.deps/gtkmmocascade-main.Tpo”; exit 1; fi
In file included from /usr/include/c++/4.2/backward/iostream.h:31,
from /usr/include/opencascade/Standard_Stream.hxx:17,
from /usr/include/opencascade/Standard_OStream.hxx:7,
from /usr/include/opencascade/Standard.hxx:40,
from /usr/include/opencascade/AIS_InteractiveContext.hxx:27,
from ./gtkmmocascade.h:12,
from main.cpp:2:
/usr/include/c++/4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
In file included from /usr/include/opencascade/Standard_OutOfRange.hxx:33,
from /usr/include/opencascade/TCollection_AsciiString.lxx:2,
from /usr/include/opencascade/TCollection_AsciiString.hxx:752,
from /usr/include/opencascade/AIS_InteractiveContext.hxx:52,
from ./gtkmmocascade.h:12,
from main.cpp:2:
/usr/include/opencascade/Standard_SStream.hxx:21:25: error: strstream.h: No such file or directory

Ok… Lets see if I can follow whats going on..
Line 2 in main.cpp (#include ) goes to line 12 in gtkmmocascade.h (#include ) blah blah….
Some kind of deprecated kind of stuff… I wonder if can just comment the line out in gtkmmocascade.h for now.
Sort answer is no… It seems like things get much worse…

Something here but not pay dirt: http://www.opencascade.org/org/forum/thread_5670/

I think I may have done this to myself. This link is interesting…http://www.opencascade.org/org/forum/thread_6926/

I think I said -DHAVE_IOSTREAM_H when I should have said HAVE_IOSTREAM

Working through the gtkmm tutorial (Part 4)

Ok… The elections have been over for a few days but its been kind of hard to get back into my morning groove of study before work… Anyway lets see what we can do here. I’ve been sort of stuck the last couple of days around Hello World in gtkmm in the tutorial. There’s alot of good content in this tutorial, but someone I’m a different wavelength so far so I’m having a hard time staying focused on it. This sort of got me sort of unfocused browsing mode in all things gtkmm in my pc at the moment. For example… I installed gtkmm on my Ubuntu Linux box and there very interesting image of the gtkmm object hierarchy located locally on you machine… at /usr/share/doc/gtkmm-2.4/docs/reference/widget_hierarchy.png  .  I wanted to post a link but I could really find this quickly with google images.

I noticed there was a html file showing the widget hierarchy.  I thought I could just past that into this post, put that isn’t going to work… But… I just discovered something very useful.   The whole thing is interactive.  Click on the object and you go to the documentation.  I see at the bottom this was generated by Doxygen…

Actually what got me curious in the main.cc of the hello world tutorial

#include <gtkmm/main.h> #include “helloworld.h” int main (int argc, char *argv[]) { Gtk::Main kit(argc, argv); HelloWorld helloworld; //Shows the window and returns when it is closed. Gtk::Main::run(helloworld); return 0; }

The tutorial states that any time you use gtkmm you need this in your main function call: Gtk::Main kit(argc, argv); and it follows that if you have that you need this also #include <gtkmm/main.h> . I was looking at the “/usr/include/gtkmm-2.4/gtkmm/main.h”.  There is so much going on there, I’m not going to get myself off track there.  Very interesting stuff, but I think I found just doing to  add that  to my  to do list.. Studying how the gtkmm wrapper is designed to go around gtkmm.  But as they say that’s for another day..  Hmm… That’s an idea… adding  a todo list to my blog… Ehh… So this project has the following files the project

  • helloworld.cc
  • helloworld.h
  • main.cc

Looking through main.cc nothing really confuses… I suppose lets look at the header file helloworld.h

#ifndef GTKMM_EXAMPLE_HELLOWORLD_H
#define GTKMM_EXAMPLE_HELLOWORLD_H

#include <gtkmm/button.h>
#include <gtkmm/window.h>

class HelloWorld : public Gtk::Window
{

public:
HelloWorld();
virtual ~HelloWorld();

protected:
//Signal handlers:
virtual void on_button_clicked();

//Member widgets:
Gtk::Button m_button;
};

#endif // GTKMM_EXAMPLE_HELLOWORLD_H

Ok.. Lets see… I understand whats going on with

class HelloWorld : public Gtk::Window

But its not burned into memory on how to describe it..  Let me check… Hmm.  The site I had in mind isn’t book marked in my favorites yet…. I think I have hard copy somewhere buried on my desk………… Not under the cat…. Ok… Here it is … Published by Juan Soulie…. No hyperlink on the printout… Lil google and here’s the link: http://www.cplusplus.com/doc/tutorial/ I haven’t looked at this since I first started this endeavor.  As I recall, it was so concise you needed it was giving me brain overload…. Well I sort of understand this stuff again and lets give it a try. Bother time for work..  Ok…. I’m back from work and nice and quite in the morning.
Yikes, I just re-read my post.  It required a bunch of editing…  Oopps.
Anyway… Working from the inside out.
The “::” is known as the scoping operator. Quote from the tutorial:classes(I)

The scope operator (::) specifies the class to which the member being declared belongs, granting exactly the same scope properties as if this function definition was directly included within the class definition.

That seems straight forward enough..
Refering to tutorial(inheritance) Now the “:” is the mechanism by which the derived class “Helloworld” inherits all the public member functions of the base class.
So as far as the “Class”, at this point I get it…

At this point, I feel like I have a pretty good grasp has far as whats going on with the constructor

HelloWorld();

and the destructor sort of makes sense to me, but I’m still a little fuzzy on the term virtual….

virtual ~HelloWorld();

The going through the tutorial reference of polymorphism to understand this.
I ran through the tutorial and I understand what virtual does but not well enough to explain it. So… I’m going to quote from the tutorial:

Therefore, what the virtual keyword does is to allow a member of a derived class with the same name as one in the base class to be appropriately called from a pointer, and more precisely when the type of the pointer is a pointer to the base class but is pointing to an object of the derived class, as in the above example.

A class that declares or inherits a virtual function is called a polymorphic class.

I see this virtual constantly, with destructors in source code I’ve been perusing I did a quick google search and found some a nice explanation on why it’s done.
http://www.ehow.com/how_2156256_use-c-virtual-destructors.html
I guess the purpose to this prevent memory leaks.

On the rest of stuff in the helloworld.h seems fairly clear to me, but I’m sure I’ll have some issues when I dig into actual function definitions in helloworld.cc. Well lets see:

#include “helloworld.h”
#include

HelloWorld::HelloWorld()
: m_button(“Hello World”) // creates a new button with label “Hello World”.
{
// Sets the border width of the window.
set_border_width(10);

// When the button receives the “clicked” signal, it will call the
// on_button_clicked() method defined below.
m_button.signal_clicked().connect(sigc::mem_fun(*this,
&HelloWorld::on_button_clicked));

// This packs the button into the Window (a container).
add(m_button);

// The final step is to display this newly created widget…
m_button.show();
}

HelloWorld::~HelloWorld()
{
}

void HelloWorld::on_button_clicked()
{
std::cout << “Hello World” << std::endl;
}

I was just thinking I don’t even think I got this thing to run yet..
Lets see….

jonas@Ubuntu4:~/gtkmm_examples/book/helloworld$ ls
helloworld.cc helloworld.h main.cc
jonas@Ubuntu4:~/gtkmm_examples/book/helloworld$ g++ main.cc -o helloworld `pkg-config gtkmm-2.4 –cflags –libs`
/tmp/ccwMhi0L.o: In function `main’:
main.cc:(.text+0×143): undefined reference to `HelloWorld::HelloWorld()’
main.cc:(.text+0×160): undefined reference to `HelloWorld::~HelloWorld()’
main.cc:(.text+0×173): undefined reference to `HelloWorld::~HelloWorld()’
collect2: ld returned 1 exit status
jonas@Ubuntu4:~/gtkmm_examples/book/helloworld$

Now that is strange….
Doh….. I found my this exact error on a Polish ubuntu site….. I wish I could read Polish (it looks like they gave the guy who made the post a little grief, but it gave me the clue to the now obvious mistake I made. Me bad… Let me try this…

jonas@Ubuntu4:~/gtkmm_examples/book/helloworld$ ls
helloworld.cc helloworld.h main.cc
jonas@Ubuntu4:~/gtkmm_examples/book/helloworld$ g++ main.cc helloworld.cc -o helloworld `pkg-config gtkmm-2.4 –cflags –libs`
jonas@Ubuntu4:~/gtkmm_examples/book/helloworld$ ls
helloworld helloworld.cc helloworld.h main.cc
jonas@Ubuntu4:~/gtkmm_examples/book/helloworld$ ./helloworld
Hello World

Much Much better :)
Ok… So much for the quiet Saturday morning…. The whole family from the Wife down to the dogs are coming in to say good morning…..
Ok… The wife is surfing the daughter is working on a computer game… so onward to helloworld.cc
Soo the code section looks like:

#include “helloworld.h”
#include <iostream>

HelloWorld::HelloWorld()
: m_button(“Hello World”)   // creates a new button with label “Hello World”.
{
// Sets the border width of the window.
set_border_width(10);

// When the button receives the “clicked” signal, it will call the
// on_button_clicked() method defined below.
m_button.signal_clicked().connect(sigc::mem_fun(*this,
&HelloWorld::on_button_clicked));

// This packs the button into the Window (a container).
add(m_button);

// The final step is to display this newly created widget…
m_button.show();
}

HelloWorld::~HelloWorld()
{
}

void HelloWorld::on_button_clicked()
{
std::cout << “Hello World” << std::endl;
}

The first thing I need to refresh on is the use of the initialiser [ or is an initializer] statement.

HelloWorld::HelloWorld()
: m_button(“Hello World”) // creates a new button with label “Hello World”.
{

I vaguely remember running across this in the Kuntz course. Lets see if I can find a better explanation..
Hmm. I was googling to see if what I could find and I just ran past an interesting post on the ubuntu forum:looking for a _sane_ way to use GTK with C++

One of the links points to: Gtk::builder
And yet another tutorial on how to use it:
GTK+ and Glade3 GUI Programming Tutorial – Part 1
This also led me to: VB Programmer’s Intro to Linux Programming with GTK+
Ohhh boy this guy has a lot of cool stuff how about this:
Using Your PC Sound Card As an Oscilloscope in Linux

Ok…. This has got me very intrigued. Working through this gtkmm hasn’t been exactly what I call results orientated.
This direct gtkmm coding approach is somewhat tedious…. I think I’m going to give this glade a look.