To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 3500
3499  |  3501
Subject: 
Re: Spirit + C++ Builder - help!
Newsgroups: 
lugnet.robotics
Date: 
Sat, 6 Feb 1999 10:46:28 GMT
Viewed: 
1202 times
  
Alan Bone wrote:

I am trying to use the spirit OCX from Borland C++ Builder, but when I try
to add the ocx, I get errors :

[Pascal Error] spirit.pas(24); Identifier redeclared: 'Spirit'.
[Pascal Fatal Error] pasall.tmp(4): Could not compile used unit ' d:\program
files\borland\cbuilder\lib\spirit.pas'.

Does anyone know how to cure this, or had success using C++ Builder with the
Spirit OCX. I would appreciate any help anyone could give.


I experienced the same problem. It seems to be related to the way C++
Builder handles the Pascal generated Spirit.ocx library, which I have
seen suggested was compiled with Borland's Delphi :-/
The filename chosen by C++ builder for the .pas file causes a conflict
with one of the constants defined within it.

The solution that worked for me was as follows:-

1. Start up C++ Builder and select 'Component, Install'. If a reference
to SPIRIT appears in the 'Installed Components' list select it and click
'Remove'.
2. Click on 'ActiveX'.
3. Select 'LEGO PBrickControl, OLE Control module'.
4. Change 'Unit file name' from '$(BCB)\LIB\SPIRIT.pas' to
$(BCB)\LIB\PBrickCtrl.pas'. (This is the bit that fixes the pascal
errors).
5. Click 'OK'.
6. 'PBrickCtrl' should now appear in the installed components list.
7. Click 'OK'.
8. The component library should now recompile automatically and the LEGO
icon appear under the ActiveX tab.

There are still some problems when compiling code for the RCX with
warnings about constant declarations which I have temporarily bodged
round by commenting out the following lines from the automatically
generated 'CBuilder\LIB\pbrickctrl.hpp' file :-/

#define HIGH_PRIORITY_CLASS (Byte)(1)
#define IDLE_PRIORITY_CLASS (Byte)(2)
#define NORMAL_PRIORITY_CLASS (Byte)(3)
#define REALTIME_PRIORITY_CLASS (Byte)(4)
#define THREAD_PRIORITY_ABOVE_NORMAL (Byte)(0)
#define THREAD_PRIORITY_BELOW_NORMAL (Byte)(1)
#define THREAD_PRIORITY_HIGHEST (Byte)(2)
#define THREAD_PRIORITY_IDLE (Byte)(3)
#define THREAD_PRIORITY_LOWEST (Byte)(4)
#define THREAD_PRIORITY_NORMAL (Byte)(5)
#define THREAD_PRIORITY_TIME_CRITICAL (Byte)(6)

Also check out the contents of 'CBuilder\LIB\PBrickCtrl.pas' as there
are some name conversions of the TSpirit methods where they conflict
with
reserved words.

Sorry its is so long after your original post but I don't often get
around to reading the news.

Hope this helps you out :-)

--
Steve Finch
Please remove the 'X' to reply.



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR