Entries Tagged as 'OpenCascade'

Problems with my first heekcad rapidSVN update.

Ok…. So I think I fixed my first bug in Heekscad…. and I’m trying to upload my code…But for some reason RapidSVN is giving me this error.

Execute: Update
Error: Error while performing action: Working copy ‘/home/jonas/Desktop/HeeksCAD/src’ locked
Ready

Apparently, this is not a big deal according to this:…
http://subversion.tigris.org/faq.html#wedged-wc
So… According to this all I need to do is this..
jonas@Ubuntu4:~$ svn cleanup working-copy
svn: ‘working-copy’ does not exist
jonas@Ubuntu4:~$ sudo updatedb
[sudo] password for jonas:
jonas@Ubuntu4:~$ locate working-copy
jonas@Ubuntu4:~$
Ok…. Time for the brute force method….

Fire up the not so rapid rapidSVN.
I’m going to copy my project file into the desktop and just going to blow away heekscad in my desktop.

duh….. Maybe I should read the instructions first:http://code.google.com/p/heekscad/source/checkout

Lets try this again….
For a command line I did the following:

svn checkout https://heekscad.googlecode.com/svn/trunk/ /home/jonas/Desktop/HeeksCAD –username yourusername

The first time did this….. I stuck in the password I got from http://code.google.com/p/heekscad/source/checkout when is was logged in.  Apparently you just need to do this once.

I got some interesting idea’s from this link http://www.cmcrossroads.com/content/view/6517/120/

I’m interesting in see if there is anything echo back in the makefile.

Ok… Here’s some more info on makefiles.

I keep getting errors with RapidSVN

Execute: Unlock
Error: Error while performing action: Working copy ‘/home/jonas/Desktop/HeeksCAD/src’ locked
Ready

http://makepp.sourceforge.net/1.19/makepp_statements.html

This might be the solution to my error issues I was getting

http://www.nabble.com/Error:-locked-td22086862.html

Oh…. I just tried this:

jonas@Ubuntu4:~$ sudo aptitude remove subversion
[sudo] password for jonas:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Reading extended state information
Initializing package states… Done
Writing extended state information… Done
Building tag database… Done
The following packages are unused and will be REMOVED:
ant ant-optional javahelp2 junit junit4 libaccess-bridge-java
libcommons-beanutils-java libcommons-collections3-java
libcommons-digester-java libcommons-logging-java libdb4.5-java
libfreemarker-java libjsch-java libjtidy-java liblucene2-java
libnb-platform7-devel-java libnb-platform7-java libopencascade6.2
libregexp-java libservlet2.3-java libswing-layout-java libtriangle-1.6
libtriangle-dev libwxbase2.6-dev libxml-commons-resolver1.1-java rhino
subversion wx2.6-headers
The following packages have been kept back:
app-install-data-commercial
The following partially installed packages will be configured:
acpid cron
0 packages upgraded, 0 newly installed, 28 to remove and 1 not upgraded.
Need to get 0B of archives. After unpacking 178MB will be freed.
Do you want to continue? [Y/n/?] y
Writing extended state information… Done
(Reading database … 329334 files and directories currently installed.)
Removing ant-optional …
Removing ant …
Removing libnb-platform7-java …
Removing libnb-platform7-devel-java …
Removing javahelp2 …
Removing junit …
Removing junit4 …
Removing libaccess-bridge-java …
Removing liblucene2-java …
Removing libcommons-digester-java …
Removing libcommons-beanutils-java …
Removing libcommons-collections3-java …
Removing libcommons-logging-java …
Removing libdb4.5-java …
Removing libfreemarker-java …
Removing libjsch-java …
Removing libjtidy-java …
Removing libopencascade6.2 …
Removing libregexp-java …
Removing libservlet2.3-java …
Removing libswing-layout-java …
Removing libtriangle-dev …
Removing libtriangle-1.6 …
Removing libwxbase2.6-dev …
Removing libxml-commons-resolver1.1-java …
Removing rhino …
Removing subversion …
Removing wx2.6-headers …
Processing triggers for man-db …
Processing triggers for libc6 …
ldconfig deferred processing now taking place
Setting up cron (3.0pl1-100ubuntu2.1) …
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> defaults [NN | SS KK]
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
-n: not really
-f: force
dpkg: error processing cron (–configure):
subprocess post-installation script returned error exit status 1
Setting up acpid (1.0.4-5ubuntu9.3) …
* Stopping Hardware abstraction layer hald                              [ OK ]
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> defaults [NN | SS KK]
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
-n: not really
-f: force
dpkg: error processing acpid (–configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
cron
acpid
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up acpid (1.0.4-5ubuntu9.3) …
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> defaults [NN | SS KK]
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
-n: not really
-f: force
dpkg: error processing acpid (–configure):
subprocess post-installation script returned error exit status 1
Setting up cron (3.0pl1-100ubuntu2.1) …
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> defaults [NN | SS KK]
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
-n: not really
-f: force
dpkg: error processing cron (–configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
acpid
cron
Reading package lists… Done
Building dependency tree
Reading state information… Done
Reading extended state information
Initializing package states… Done
Writing extended state information… Done
Building tag database… Done
jonas@Ubuntu4:~$

I don’t think that’s what I wanted to do… Oh c$%p
Well…. I think I want the libopencascade6.2 back at least… I think I got that from a backport…
Well Lets see.

Ok…. this is weird….

jonas@Ubuntu4:~$ locate libopencascade6.2
/var/lib/dpkg/info/libopencascade6.2.list
/var/lib/dpkg/info/libopencascade6.2.postrm

It appears openovations has moved libopencascade6.2 into debian and I haven’t  adjusted my sources.list yet. … (which is apparently why it go removed) I ran my compiled heekscad and it got weird on me.  I rebuilt my project from scratch thinking I was going to get a message that it was missing dependancies or something… but instead it compiled and run ok…. I don’t understand that.    More for another day….

Ok…. Sooo…. This doesn’t seem to be working… Some one one the heekscad site said he had version 9.6 working…. Ok… Doesn’t look like anybody is backporting in a fix in Ubuntu…. So….
I guess the prudent thing to do would be to go to the source so to speak… Use the source luke…
Sorry…… the family is watching galaxy quest at the moment and I seem to be having a sci-fi theme tonght…

It’s morning… Back to RapidSVN I got some install instructions from the heekscad group..

Got basic instructions on how to get this working here…http://www.tuxfiles.org/linuxhelp/softinstall.html.  I must say it very well written.  Ok… Lets put the to together…

Download the Source  http://www.rapidsvn.org/download/release/0.9.6/rapidsvn-0.9.6.tar.gz
Install following (Synaptic) :

APR(dev)  ( I clicked on libr1apr-dev)  (lib1apr, lib1aprutil1 (already installed) /We’ll see if that’s enough)
NEON(dev) ( I clicked on libneon27-dev) (libneon27, libneon27-gnutils (already installed)
Subversion Headers(clicked on libsvn-dev (that apparently loaded up a bunch of dependancies.. libsvn1,libssvncpp0c2a was already loaded)

In summary:

libapr1-dev (version 1.2.11-1) will be installed
libaprutil1-dev (version 1.2.12+dfsg-3ubuntu0.1) will be installed
libdb4.6-dev (version 4.6.21-6ubuntu1) will be installed
libldap2-dev (version 2.4.9-0ubuntu0.8.04.2) will be installed
libneon27-dev (version 0.27.2-1) will be installed
libpcre3-dev (version 7.4-1ubuntu2.1) will be installed
libpcrecpp0 (version 7.4-1ubuntu2.1) will be installed
libsqlite3-dev (version 3.4.2-2) will be installed
libsvn-dev (version 1.5.1dfsg1-1ubuntu2~hardy2) will be installed
uuid-dev (version 1.2-1.40.8-2ubuntu2) will be installed

Ok… Then here is the history of what I did.

505  cd downloads
506  ls
507  tar xvzf rapidsvn-0.9.6.tar.gz
508  ls
509  cd rapidsvn-0.9.6
510  ./configure
511  make
512  sudo make install
513  sudo ln -s /usr/local/lib/libsvncpp.so.1 /usr/lib/libsvncpp.so.1
514  rapidsvn
515  history

I had some issues when I tried to download the source so I deleted the link, the files and tried to start from scratch..  I also made the minor fix for RUNINPLACE
Ok… Lets see here’s the link:http://code.google.com/p/heekscad/wiki/CompilingForUbuntu

Ok.. I just did a

make clean
make
sudo make install
in my src directory.. Closed the terminal, fired it back up (to get to my home directory.. I fired it up worked fine..
Tried to fire up the executable in the source directory and got the error message as expected.
Back to the src directory.

After installing if I enter a
RUNINPLACE=yes make
I get a message that everything is updated.

Soo… I needed to

make clean
RUNINPLACE=yes make
And this seems to have worked fine.
So I made some changes that I want to up load…
Ok… So I’m pretty sure I did everything correctly.
I did an update, clean and commit.  and I can’t get past the password.
I keep getting bounced back to the inputbox and when I hit enter I get this:

Execute: Commit
Error: Error while performing action: Commit failed (details follow):
MKACTIVITY of ‘/svn/!svn/act/55d882bc-315a-46b3-9d66-7fd9e717e76b’: authorization failed (http://heekscad.googlecode.com)
Ready

Back from vacation…. Lets see if I can pick this up again….
Ok…. I’ve been gone for a few days so…….

I’m going to delete the reference in rapidsvn and  blow away my heekscad directory to start from scratch…… Soo…. Lets see what happens..

Fire up rapidsvn.. Select Repository=> Checkout
Enter…
Repository Url:

https://heekscad.googlecode.com/svn/trunk/

Path:
/home/jonas/Desktop/HeeksCAD

And I take a look at where I wanted to fix the RUNINPLACE code and……. It’s been fixed already…  Plus it looks like Dan Heeks and company has added a code::blocks project file….
Leave for vacation for a few days and a bunch of stuff changes….
Well…… go figure… I guess no first rapidSVN update tonight…

Working through the zetcode wxwidgets tutorial:Device Contexts:Pen/Regions

Everything, is fairly straight forward in the pen example. It uses wxDC::DrawRectangle where is an abstract data class for wxPaintDC. Basically a bunch of rectangles are drawn with different patterns.
The patterns are defined constructor in wxPen

So… on to Regions… Now piece of sample codes gets a little more interesting to me…
This is one of those instance where a picture is worth a thousand words…

On a side note, at some point I need to get back to drag and drop. I just fired up Inkscape and dragged and dropped the png into it.  I’m thinking about adding some  some notes on the graphic.  I’m going to have to learn how to do that… I basically bypassed it in this tutorial..

In zetcode’s sample code nearly each set of squares is build around the same template.

dc.SetBrush(wxBrush(white));
dc.DrawRectangle(100, 20, 50, 50);
dc.DrawRectangle(110, 40, 50, 50);
wxRegion region1(100, 20, 50, 50);
wxRegion region2(110, 40, 50, 50);
region1.Intersect(region2);
wxRect rect1 = region1.GetBox();
dc.SetClippingRegion(region1);
dc.SetBrush(wxBrush(red));
dc.DrawRectangle(rect1);
dc.DestroyClippingRegion();

Ok.. lets see. SetBrush, Drawrectangle, been there/ done that..
wxRegion, SetClippingRegion , DestroyClippingRegion are new for me.

I basically copied this from the wxsite

wxRegion

A wxRegion represents a simple or complex region on a device context or window.

This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.

Derived from

wxGDIObject
wxObject

Include files

<wx/region.h>

See also

wxRegionIterator

Members

wxRegion::wxRegion
wxRegion::~wxRegion
wxRegion::Clear
wxRegion::Contains
wxRegion::ConvertToBitmap
wxRegion::GetBox
wxRegion::Intersect
wxRegion::IsEmpty
wxRegion::IsEqual
wxRegion::Subtract
wxRegion::Offset
wxRegion::Union
wxRegion::Xor
wxRegion::operator =

(Part 1 wxFrame)Exploring wxwidgets using zetcode’s “A simple button” and Code::Blocks

Many moons ago, a friend of mine at lunch said that I ate like a Romulan. I guess I take my food apart before I eat it.
I guess I take the same approach learning new things.

In my previous post I went over how get this zetcode titled “A Simple button” using the IDE C::B Code::Blocks.
http://zetcode.com/tutorials/wxwidgetstutorial/firstprograms/
This produces some output that looks like this:

My previous post was more of a tutorial, this is more note pad for me for my exploration into both Code::blocks and wxwidgets.
The code I’m interested in looking at is the the file button.cpp:

#include “button.h”

Button::Button(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(270, 150))
{
wxPanel *panel = new wxPanel(this, wxID_ANY);

wxButton *button = new wxButton(panel, wxID_EXIT, wxT(“Quit”),
wxPoint(20, 20));
Connect(wxID_EXIT, wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(Button::OnQuit));
button->SetFocus();
Centre();
}

void Button::OnQuit(wxCommandEvent & WXUNUSED(event))
{
Close(true);
}

Starting out I’m interested in researching the contructor for wxFrame.
Searching locally on my machine this is what I came up with.

jonas@Ubuntu4:~$
jonas@Ubuntu4:~$ locate wxframe
/usr/share/doc/wx2.6-doc/wx-manual.html/wx2.6-manual_wxframe.html
/usr/share/doc/wx2.8-doc/wx-manual.html/wx_wxframe.html
jonas@Ubuntu4:~$ locate wx/frame
/usr/include/wx-2.6/wx/frame.h
/usr/include/wx-2.8/wx/frame.h
jonas@Ubuntu4:~$

Looking inside usr/include/wx-2.8/wx/frame.h here is the constructor:

wxFrame *New(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);

(Ok…. One think that is really irritating at the moment is that I’m loosing what I guess is tabs when I switching between Visual and Html in my wordpress software…. I’m not interesting in following that thread at the moment so sorry about that.)

Anyway.. As near as I can tell, It appears that data contained in /usr/include/wx-2.8/wx/frame.h mirror’s that which is on the website:http://docs.wxwidgets.org/stable/wx_wxframe.html

Going through each parameter in the constructor

wxWindow *parent, // Makes sense to me.. Not going to pursue further
wxWindowID winid, // This has gotten me curious.  I need to research this further. I think I between these two links it sort of explains it.
http://docs.wxwidgets.org/stable/wx_wxframe.html
Refers to it as “The window identifier.”

[http://docs.wxwidgets.org/stable/wx_….html#stdevtid I have a theory in my head as to what this does, but I want to work it out in samples .

const wxString& title, // This seems to be a no brainer to me.

const wxPoint& pos = wxDefaultPosition, // This one merits a little bit of research
Nice explanation here:http://docs.wxwidgets.org/stable/wx_wxpoint.html#wxpointoperators
Simple stated:

A wxPoint is a useful data structure for graphics operations. It simply contains integer x and y members.

const wxSize& size = wxDefaultSize, In formation on that can be found here:http://docs.wxwidgets.org/stable/wx_wxsize.html#wxsize

Quoting:

A wxSize is a useful data structure for graphics operations. It simply contains integer width and height members.

To me these statements are a bit misleading, looking through the documentation there is a bunch of interesting member functions associated with these classes..

long style = wxDEFAULT_FRAME_STYLE, //Ok… This is is pretty much explained in wxframe, so this is a no-brainer to me.

const wxString& name = wxFrameNameStr); wxframe defines this as:

The name of the window. This parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual windows.

It sound to me than in Vb6 speak. “Name” is the “name” and “title” would be the “caption”.

Ok… That’s enough for now..
I think the next thing to really look at is:

wxPanel *panel = new wxPanel(this, wxID_ANY);

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.

Working through the Openismus’s example code for Automake (Part 2)

I’ve been working on dissecting so sample code from the Openismus site for Automake.

I was searching through code search to post a link here and I noticed that they had basic sample projects for creating and installing libraries.  I’m still focused on reviewing the basic Automake, perhaps this will be a topic for another day.

Based on what I’ve learned from the most excellent EPITA – LRD tutorial, the main files, from which everything else sprouts are the configure.ac and makefile.am’s that occur in the project.

So… In the previous post I tore apart the configure.ac (which had deprecated features in it).

Today, I want to look at the makefile.am’s in the project:helloworld_cc-0.3.tar.gz

The sample project download on my machine and look like this:

jonas@Ubuntu4:~/helloworld_cc-0.3$ ls -1 -R
.:
aclocal.m4
AUTHORS
autogen.sh
ChangeLog
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.ac
COPYING
depcomp
INSTALL
install-sh
libtool
ltmain.sh
Makefile
Makefile.am
Makefile.in
missing
mkinstalldirs
NEWS
README
src
stamp-h1
./src:
foofiles
hello
hello.cc
hello.h
hello.o
main.cc
main.o
Makefile
Makefile.am
Makefile.in

./src/foofiles:
foo.cc
foo.h
foo.o
libfoo.a
Makefile
Makefile.am
Makefile.in
jonas@Ubuntu4:~/helloworld_cc-0.3$

There are 3 Makefile.am’s files to look at.

I was looking at these files:

I think that before I dive into this, I need to do a little basic research on what all this Makefile stuff is all about for context… I found some interesting stuff here which I need to digest.

On the most excellent EPITA – LRD tutorial,  Automake starts around page 295.

Btw,, Openismus discusses the non self-explanatory macros pretty well as far as what’s going on..

The LRD tutorial talks (~311)about the FHS , This  wiki link describes it pretty well.

I think I may have bit a few do many data sources in one bite here.  This is somewhat overwhelming to someone who grew up in the Ms-dos world…. Yikes…..

Ok… Time to break this down into little itty bitty pieces so this goes down easier.

Makefile.am

SUBDIRS = src
EXTRA_DIST=autogen.sh

Page 332 of the LRD tutorial discuss SUBDIRS

Points made:

  • One Makefile ergo, one Makefile.am per directory
  • You run make from the top directory
  • It figures out where to go by navigate through the directories called out in SUBDIRS in the individual make files.
  • All the Makefiles are declared in configure.ac

So the contents of configure.ac are;

AC_INIT(src/hello.cc)
AM_INIT_AUTOMAKE(helloworld_cc,0.3)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_OUTPUT(Makefile src/Makefile src/foofiles/Makefile)

Wow that was scary. It makes perfect sense.

Lets see what I can find as far as that deal with the EXTRA_DIST:

Page 359 in the tutorial says, EXTRA_DIST comes into play in the creation of tarballs. It’s used for adding extra files above and beyond what is normally done in the process.

While reading the linked wiki page about tarballs there was some discussion about tarbombs. This is something I’m going to need to research in the furture, when I get to the point of having some applications I wish to distribute.

./src/Makefile.am

bin_PROGRAMS = hello

hello_SOURCES = hello.h hello.cc main.cc

SUBDIRS = foofiles

LDADD = foofiles/libfoo.a

The first three lines make sense to me, So that leaves LDADD. Basically has to do with letting up libraries.  Page 427 of the tutorial EPITA – LRD tutorial, discusses that…  Back in a few minutes….

Ok… this LDADD is still a bit fuzzy for me, gut here’s what I got out of the tutorial. LDADD is the command that you use when linking up a library.  LDADD by itself without a lower case prefix is the global form.

According to the tutorial you’ll see the library name with a “la” suffix when you’re using a full library.  not the “a” we have here… When Automake runs across the “la” will figure out whether it should has a  .so or .dll extension depending on your os.    The “.a” is a convenience used when building the library (I hope I read that right).

Ok.. (page 438) apparently to use a library you need to cover your bases so to speak in three spots: configure.ac (AC_PROG_LIBTOOL), Makefile.am  (LDADD ) where you want to link, Makefile.am(LTLIBRARIES) what your linking.. Lets see

configure.ac

AC_INIT(src/hello.cc)
AM_INIT_AUTOMAKE(helloworld_cc,0.3)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LIBTOOL

AC_OUTPUT(Makefile src/Makefile src/foofiles/Makefile)

./src/Makefile.am

bin_PROGRAMS = hello
hello_SOURCES = hello.h hello.cc main.cc
SUBDIRS = foofiles

LDADD = foofiles/libfoo.a

./src/foofiles/Makefile.am

noinst_LIBRARIES = libfoo.a

libfoo_a_SOURCES = foo.h foo.cc

INCLUDE = -I@top_srcdir@/

#$% I was hoping for a match between the tutorial and the code… There is a difference in that the tutorial refers to “LTLIBRARY” and the code has plain “LIBRARY” So I’m not sure is LT is used with .la extensions only or If “LIBRARY” is something deprecated… The tutorial really seems to like LTLIBRARY… Off to GNU land…

Ok… I’m still confused..

I found some reference http://ftp.gnu.org/old-gnu/Manuals/automake-1.6.1/html_chapter/automake_9.html#SEC30

Doesn’t say anything about deprecation but having old_gnu in the hyperlink doesn’t make me feel any better.

Ok…. Back to my favorite tutorial.. It looks like talks about _LIBRARIES and _LTLIBRARIES (Libtool libraries)  Off to wikipedia

I’m not seeing this explicitely stated, but It sound like LTLIBRARIES invokes the big guns of libtool cross platform support, and plain old LIBRARIES doesn’t….  My head is starting to ache So I’m moving on to ./src/foofiles/Makefile.am

./src/foofiles/Makefile.am

noinst_LIBRARIES = libfoo.a

libfoo_a_SOURCES = foo.h foo.cc

INCLUDE = -I@top_srcdir@/

So here’s a link that describes whats going on with noinst_LIBRARIES

That link and couple of buzzword terms that I’ve seen and never bothered to understand.

canonicalize

Obfuscation

Now it sort of  makes sense why libfoo.a turns gets referenced as libfoo_a in the next line..
So…. that leaves “INCLUDE = -I@top_srcdir@/”
So… I found that top_srcdir is a makefile variable.  I need think I know what’s going on here but not well enough to explain.   I need to find a line that explains the use of @’s and $’s.
I found a link that sort explains the “@” aka the strudel. Basically here’s the pertinent code:

3.4 How derived variables are named

Sometimes a Makefile variable name is derived from some text the maintainer supplies. For instance, a program name listed in ‘_PROGRAMS’ is rewritten into the name of a ‘_SOURCES’ variable. In cases like this, Automake canonicalizes the text, so that program names and the like do not have to follow Makefile variable naming rules. All characters in the name except for letters, numbers, the strudel (@), and the underscore are turned into underscores when making variable references.

For example, if your program is named sniff-glue, the derived variable name would be ‘sniff_glue_SOURCES’, not ‘sniff-glue_SOURCES’. Similarly the sources for a library named libmumble++.a should be listed in the ‘libmumble___a_SOURCES’ variable.

The strudel is an addition, to make the use of Autoconf substitutions in variable names less obfuscating.

I need to move on too somthing else….

Working on the theme

The original networker-10 out of the box

OK,,, I’m really starting to diverge from the path here……. But this plain blue is just not me….
I found some interesting information on themes:…http://codex.wordpress.org/Using_Themes/Theme_List
I thinking I’m going to be sticking to stuff of the WordPress site instead of looking for third party sites for clever add-on until I get to a point when I feel comfortable with what I’m doing..
The wordpress site points into a how to video tutorial: http://www.village-idiot.org/archives/2008/06/13/how-to-upload-a-wordpress-theme/ (I’m not on one save wavelength so this didn’t work for me….)
But… I went to the WordPress download site.

The theme my wife helped me pick out this theme case networker-10 .  The irony of this is that I’ve visited the authors site….  Let’s see what I can’t do with this….
OK… I guess I should benchmark what this template originally looked like before I started modifying it.

Solving the libstdc++-libc6.1-1.so.2 issue for Opencascade for Gutsy Gibbon

Ok… Researching this it seems that everyone and there uncle seems to have had this issue trying to install Opencascade on Ubuntu….
I guess this is my attempt.
Looking over the numerous threads spread across the internet this is the one it thought I pursue first:

At the bottom of the thread was this:http://www.opencascade.org/org/forum/thread_11215/
“Just FYI, this also works on Ubuntu Feisty. You also need to install libstdc++2.10-glibc2.2 then create a symbolic link from /usr/lib/libstdc++-libc6.2-2.so.3 to /usr/lib/libstdc++-libc6.1-1.so.2.
EH”
So checking stuff out.

jonas@jonas-desktop:~$ sudo updatedb
[sudo] password for jonas:
jonas@jonas-desktop:~$ locate /usr/lib/libstdc++-libc6.2-2.so.3
/usr/lib/libstdc++-libc6.2-2.so.3
jonas@jonas-desktop:~$ cd /usr/lib/libstdc++-libc6.2-2.so.3
bash: cd: /usr/lib/libstdc++-libc6.2-2.so.3: Not a directory
jonas@jonas-desktop:~$ cd /usr/lib
jonas@jonas-desktop:/usr/lib$ ls -a libstdc++-libc6.2-2.so.3
libstdc++-libc6.2-2.so.3
jonas@jonas-desktop:/usr/lib$

This has me befuddled at the moment…It appears that libstdc++-libc6.2-2.so.3 is not a folder. So what is it?? I sure there’s a way from spitting this out from the command line but using the file browser this appears to a link to a shared library( /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so to be precise) Ok so I think the command line I need to to the link is:

sudo ln -s libstdc++-libc6.2-2.so.3 /usr/lib/libstdc++-libc6.1-1.so.2

Results are:

jonas@jonas-desktop:~$ sudo ln -s libstdc++-libc6.2-2.so.3 /usr/lib/libstdc++-libc6.1-1.so.2
[sudo] password for jonas:
jonas@jonas-desktop:~$ sudo updatedb
jonas@jonas-desktop:~$ locate /usr/lib/libstdc++-libc6.1-1.so.2
/usr/lib/libstdc++-libc6.1-1.so.2
jonas@jonas-desktop:~$

It looks like it took… Know the test is to run the document installation script again and see what happens:
jonas@jonas-desktop:~$ cd Opencascade_documentation
jonas@jonas-desktop:~/Opencascade_documentation$ csh
% ls
Autorun.inf images install.bat install.csh OpenCASCADE_doc.tgz package readme.htm
% cd -x install.csh
Usage: cd [-lvn] [<dir>].
% csh -x install.csh
setenv JAVAHOME .
set OS_NAME=`uname`
uname
if ( Linux == SunOS ) then
if ( Linux == Linux ) then
./package/setupLinux.bin
InstallShield Wizard

Initializing InstallShield Wizard…

Preparing Java(tm) Virtual Machine…
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
……………………………..
..endif
%

I guess it took..
According to the readme.htm file in the download the documentation should have dumped into /opt/OCCTDocumentation6.2.0 directory
Well it didn’t…. I did a updatedb and tried to locate OCC and well here are the results.
jonas@jonas-desktop:~/Opencascade_documentation$ locate occ
/usr/share/pixmaps/faces/soccerball.png
/usr/share/pixmaps/pidgin/emotes/default/soccerball.png
jonas@jonas-desktop:~/Opencascade_documentation$ locate OCC
/home/jonas/Desktop/OCC50_Overview.pdf
jonas@jonas-desktop:~/Opencascade_documentation$

The pdf was something I found earlier…. Ah Heck…. It didn’t error out but it didn’t do what it was supposed to do.. Time for more research….. To quote the penguins from the movie Madagascar when they reach the Antarctic… Well… this sucks…. Time for bed..

Setting up enviroment values for C-shell

I feel like the guy whose been sort of lost driving and has been sort of reluctant to ask for directions. I keep thinking I’m almost there, but I at a point where I’m posting this on the ubuntu forum. A summary of how I got to where I’m at.

I managed to set the environment variables to the bash shell successfully per his instructions but got real confused trying to set this up for the C-shell.
In this guys instructions he talks about the “simple matter” about adding Java properties to the file: /etc/csh/login.d/java
In my personal logic leads me to think that the /etc/csh/login.d would have been created at install or when I fire up csh in terminal. I suppose I could brute for and create the sub-folders, but my gut tells me that will not work. Am I wrong? I guess these are the questions I have:

  • Is /etc/csh/login.d/ something that csh recognize out of the box?
    • Do I need to manually create the folder for the file /etc/csh/login.d/java?
      I found: The C shell tutor which talks about .cshrc .login .logout

    I think all I need to do is to plot the setenv stuff is .cshrc
    Is that correct?? Where is .cshrc located?

I posted this on Ubuntu forums…. See what happens http://ubuntuforums.org/showthread.php?t=745954

I suppose I should probably update the database and see if I can answer my own questions. To create a database with the file names in the terminal go sudo updatedb, and after that Locate filename

jonas@jonas-desktop:~$ sudo updatedb
[sudo] password for jonas:
jonas@jonas-desktop:~$ locate .cshrc
jonas@jonas-desktop:~$ locate cshrc
jonas@jonas-desktop:~$
It doesn’t seem to be there…..more research req’d hopefully someone takes pity on me.