Author Topic: Using Code::Blocks with HeeksCAD  (Read 7141 times)

Offline jonas thomas

  • Multiple posting newcomer
  • *
  • Posts: 18
Using Code::Blocks with HeeksCAD
« on: June 05, 2009, 02:12:36 pm »
Hi,
I've been trying to get HeeksCAD to run using C:B's as the IDE on 32 bit 8.04 Ubuntu  http://code.google.com/p/heekscad/source/browse/#svn/trunk/src%3Fstate%3Dclosed
Initially, I compiled using the Makefile and afterwards I tried building a project using Code::Blocks
Initially I tried to build using the Makefile and after a couple attempts decided to setup the project in Code::Blocks.

I managed to get the point of getting an executable but I'm getting the following errors:
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/new.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/open.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/save.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/cut.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/copy.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/paste.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/undo.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/redo.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/select.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/lines.png': file does not exist.
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/circles.png': file does not exist.

I need to get the program to look at:
/usr/local/share/heekscad/bitmaps/circles.png (among others)

I guess I need to get this from the makefile somewhere into the project:
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
DATADIR=$(PREFIX)/share
HEEKSCADDIR=$(DATADIR)/heekscad
PIXMAPSDIR=$(DATADIR)/pixmaps
APPSDIR=$(DATADIR)/applications

Where should I stick that?
I tried building the project rather than using the existing prebuilt most for practise. 
Would I be better off using the Makefile from the heeksCAD project.

I'm am sooooo... close to getting this to working...  Rides here... gotta go to work....








Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: Using Code::Blocks with HeeksCAD
« Reply #1 on: June 05, 2009, 07:58:49 pm »
on my system compile and runs
but it eventually crash with
Code
psyhlo@psyhlo-laptop:~$ HeeksCAD 
The program 'HeeksCAD' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 1919 error_code 8 request_code 70 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Offline jonas thomas

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Using Code::Blocks with HeeksCAD
« Reply #2 on: June 06, 2009, 04:43:26 pm »
I'm a very confused here.

When I built HeeksCAD outside of C::B using the provide makefile the executable was placed:
/usr/local/bin
and the graphics where placed in:
/usr/local/shared/heekscad/bitmaps
/usr/local/shared/heekscad/icons

I have the project located in
/home/jonas/HeeksCAD

I tried to use the existing makefile ie, Project>Properties>Project Setting and selected  /home/jonas/HeeksCAD/src I got the message:

Code
-------------- Build: Debug in HeeksCAD ---------------

Using makefile: Makefile
make: *** No rule to make target `Debug'.  Stop.
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
So I figured since no rule was setup for Debug.. I'd just build the project through the IDE.

When I build and run (without the custom  makefile) the log puts out this message.
Quote
Checking for existence: /home/jonas/HeeksCAD/HeeksCAD
Executing: xterm -T HeeksCAD -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.:/home/jonas/HeeksCAD/interface /home/jonas/HeeksCAD/HeeksCAD  (in /usr/local/bin)

But I still get the error messages from the executable:
Code
07:02:01 PM: Can't load image from file '/home/jonas/HeeksCAD/bin/Debug/../share/heekscad/bitmaps/new.png': file does not exist
I interpret this to mean IDE is executing the program from /home/jonas/HeeksCAD/bin/Debug/ is try to back up one directory  then search the graphics through the path.  Put...that makes absolutely sense is  /home/jonas/HeeksCAD/bin/Debug/ doesn't exist.

I thought all I had to do was change the project>properties>Build Targets>Execution working directiory>/usr/local/bin
Made sense to me.. but I still get the same error.  I know  I'm missing something really basic here (I just don't get it at this point)
Anyone??
I wanted to post the project file put I exceeded the 20000 character limit... But... I did post it here:
http://www.metalshaperman.com/?p=171

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Using Code::Blocks with HeeksCAD
« Reply #3 on: June 06, 2009, 05:00:14 pm »
So I figured since no rule was setup for Debug.. I'd just build the project through the IDE.

If you use custom makefiles, you have to name your targets as the appropriate makefile rules, or adjust the make commands in the projects build options (tab "Make commands").
Project-wide make commands are only used, if no target make commands exist.

Offline deadneurons

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Using Code::Blocks with HeeksCAD
« Reply #4 on: June 06, 2009, 07:53:07 pm »
I'm also watching the progress of HeeksCAD, I'm a hobbycnc'ist.
Can you try this cbp, place it inside the HeeksCAD dir where src, interface, tinyxml are,
You must change the path for stdafx.h, on some headers,  changed the path of some includes in HeeksCADInterface.cpp.
you also have to specify the casroot in global variables.
I didn't finish the compilation but it's halfway through when I canceled it since I already have it built via makefile.
Hopefully this works.

[attachment deleted by admin]
« Last Edit: June 06, 2009, 07:56:07 pm by deadneurons »

Offline jonas thomas

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Using Code::Blocks with HeeksCAD
« Reply #5 on: June 06, 2009, 08:02:36 pm »
I found the source of my confusion :lol:
[/quote]
If you use custom makefiles, you have to name your targets as the appropriate makefile rules,
[/quote]
I went to project>properties (tab build targets)
It had these settings:
Output filename: HeeksCad
Execution working directory:/usr/local/bin

That was the source of my confusion.  After thinking about what you said it did the following:
Was:
Output filename: HeeksCad
change to read:
Output filename: /usr/local/bin/HeeksCad
When I did that I got a permission denied message which is the point where the light clicked on.

(I suppose I need a sudo somewhere to gain access to /usr/local/bin....)
To get around the sudo issue I changed to the following settings
Output filename: ../HeeksCAD_Executable_NotTheBestSolution/bin/HeeksCAD
Execution working directory:/usr/local/bin
(and copied the graphics over to:
/home/jonas/HeeksCAD_Executable_NotTheBestSolution/share/heekscad/bitmaps
/home/jonas/HeeksCAD_Executable_NotTheBestSolution/share/heekscad/icons

So... what is the function of the "Execution working directory:/usr/local/bin" ?

This is a real ugly solution but it works for me, so I can study the code to gain some more understanding on how this works.

Thanks....




Offline deadneurons

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Using Code::Blocks with HeeksCAD
« Reply #6 on: June 06, 2009, 08:22:07 pm »
OK, I continued the compilation, but got an error during linking,
this is the last part of the error:

Code
g++: obj/Release/src/HeeksCAD.res: No such file or directory
Process terminated with status 1 (7 minutes, 42 seconds)
0 errors, 28 warnings


EDIT: I believe it's related to resource file, unfortunately it's out of my league.
« Last Edit: June 06, 2009, 08:23:45 pm by deadneurons »

Offline jonas thomas

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Using Code::Blocks with HeeksCAD
« Reply #7 on: June 06, 2009, 08:22:32 pm »
I'm also watching the progress of HeeksCAD, I'm a hobbycnc'ist.
Can you try this cbp, place it inside the HeeksCAD dir where src, interface, tinyxml are,
You must change the path for stdafx.h, on some headers,  changed the path of some includes in HeeksCADInterface.cpp.
you also have to specify the casroot in global variables.
I didn't finish the compilation but it's halfway through when I canceled it since I already have it built via makefile.
Hopefully this works.

This is starting to digress into a discussion about Heekscad.   Mr. Code Blocks man has a tendency to lock down threads when that happens ;) ...
I tried your project file and was getting all kinds of nasty stuff about that casroot.
I think your using the Opencascade linux download instead of Adam Powell .deb file (That library is set up to debian standards which will make your life much easier if you use the .deb file.)  Anyway... My suggestion is you might want to take this discussion http://groups.google.com/group/heekscad-devel?hl=en


Offline deadneurons

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Using Code::Blocks with HeeksCAD
« Reply #8 on: June 06, 2009, 08:25:46 pm »
you're right, pardon me, just trying to help.
this should be my last post.

Offline jonas thomas

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Using Code::Blocks with HeeksCAD
« Reply #9 on: June 06, 2009, 08:48:23 pm »
you're right, pardon me, just trying to help.
this should be my last post.
Thanks (Your making feel bad now), besides.... I finally reached my initial objective has been reached... ie...
Keeping HeeksCAD to run via Code::Blocks It might be ugly, but it's enough for me to dissect.
This is so cool:
Code:Blocks, wxwidgets, C++, OpenCascade via HeeksCAD..  I need to spend a month snooping under the hood to see how this all works...
Anyway... I would like to eventually figure to setup up Code:Blocks this up properly to say in sync with the heeksCAD in the google code repository. (My clever attempt to bring the  back on C::B topic)

Offline deadneurons

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Using Code::Blocks with HeeksCAD
« Reply #10 on: June 06, 2009, 09:36:34 pm »
so it doesn't look like I just left.  :P
I made a post on the mailing list of HeeksCAD.