I've written a few C++ modules and they work fine. Maybe I'll expound
on them later.
Changes to $(DXHOME)/include/dx/UserInteractors.h have been checked in
to cvs to allow C++ programs to be linked to dxexec, with the standard
headers.
To make C++ modules even easier, I just checked in changes to dx
-builder (that is, src/uipp/mb) to have the builder emit C++ compatible
module "boilerplate" for your custom module code. There's no builder ui
control for writing a capital-C file but if you can rename mymodule.c to
mymodule.C you're in business.
There shouldn't be any reason to actually compile dxexec with a C++
compiler, but go ahead, knock yourself out.
The one (temporary?) caveat is that when dxexec is linked C++ then
(typically) initialization code gets called before dxexec's main. For
platforms for which dxexec replaces the system malloc (ibm6000 is the
only explicit case of this) dx memory calls get made before dx
initialization, a situation that dx tries to handle correctly but
currently doesn't. The workaround (again, perhaps only temporary) is to
go to src/exec/libdx/memory.c and change the ibm6000 block's #define
MALLOC_GLOBAL 1 to something else, e.g. MALLOC_NONE , then recompile the
exec branch.
Pete
Stephen Dzurenko wrote:
> Yes, the compile errors were posted in my message to this list dated
> 5/26/00.
>
> Basically, both compilers are complaining about the following
> structure in
> $(DXHOME)/include/dx/UserInteractors.h:
>
> struct _userInteractor
> {
> InitMode InitMode;
> EndMode EndMode;
> SetCamera SetCamera;
> GetCamera GetCamera;
> SetRenderable SetRenderable;
> GetRenderable GetRenderable;
> EventHandler EventHandler;
> };
>
> Both g++ 2.8.1 and Solaris C++ 5.0 report that it is an error for
> the variable name and type to be identical. We have confirmed
> this with a couple simple test programs.
>
> Any ideas? Anyone?
>
> Thanks.
>
> -Steve
>
>
> Suhaib Siddiqi wrote:
>
>> Most of the DXUI code is in C++. DX compiles with GNU G++. I do
>> notknow about Solaris. In general most of the C++ compilers should
>> compile it.Did you post the compile error log to this list? Someone
>> might be able to helpget it compile on Solaris.Suhaib
>>
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] Behalf
>> Of Stephen Dzurenko
>> Sent: Friday, June 02, 2000 10:46 AM
>> To: [email protected]
>> Subject: [opendx-dev] Does DX compile with C++??
>> Hi Folks,
>>
>> I sent out a message regarding this a few days ago. Noone
>> responded, so I'll
>> try once more.
>>
>> We have been evaluating DX for a sonar mapping system we
>> are creating.
>> We had hoped to use DX module calls to provide our system
>> with the 3D
>> viewing capability it requires. Our application will be
>> written in C++ and
>> we must make the DX module calls from within C++ objects.
>>
>> We were not able to get DX to compile with either GNU g++
>> 2.8.1 or Solaris
>> C++ 5.0. Both compilers are reporting the same errors. I
>> can send the exact
>> errors if need be, but first off, I would like to know if
>> anyone is using the DX
>> module API from within C++ code.
>>
>> Also, does anyone know whether or not this should or
>> should not be possible?
>>
>> Thanks again.
>>
>> -Steve
>>
>> --
>>
>> Stephen Dzurenko
>> Research Engineer / Scientist Associate
>>
>> Advanced Sonar Division / Advanced Technology Laboratory
>>
>> Applied Research Laboratories
>> The University of Texas at Austin
>> P.O. Box 8029
>> Austin, Texas 78713-8029
>> 10000 Burnet Road 78758-4423
>>
>
>