Re: console output under Windows [message #34536] |
Wed, 26 March 2003 15:57 |
Bill Atkins
Messages: 3 Registered: March 2003
|
Junior Member |
|
|
I initially tried gcc on a linux machine and got a compile error in export.h
(line 2834 - parse error before 'template'). This doesn't occur if I give the
file a .c extension to force the c compiler, so I proceeded to add a c layer
between IDL and the c++ code (which was already written and given me so I didn't
want to convert it to c). Now that you prompted me to try it again, I find I
don't get the error with the Sun c++ compiler, so maybe something's goofy with
gcc or my incantation of it.
Anyway, I kind of like the idea of having a separate IDL-interface layer so the
bulk of the code is IDL-unaware. But you are right - I can probably make it
work with c++. And it's obvious they intended it to work with c++ because
export.h starts with a line #ifdef __cplusplus.
Bill
Rick Towler wrote:
> "Bill Atkins" wrote
> ...
>> This doesn't quite do it for my case. Some of the routines where
>> I'd like to put print statements are in a DLL built from c++,
>> called by a DLM C routine. (export.h didn't compile with c++.)
>
> What version of IDL?
>
> I've created a few simple C++ DLMs w/o incident. Can you just create a
> single C++ DLM compiled with export.h?
>
> -Rick
>
>>
>> Bill
>>
>> Rick Towler wrote:
>>
>>> "Bill Atkins" wrote in message
>>>
>>>> Is there a way to get console output on Windows? I.e. the output from
>>>> printf statements in a C DLM routine.
>>>
>>> You mean something like this?
>>>
>>> sprintf(messageBuff, "input values: %f %f %f",data[0], data[1],
> data[2]);
>>> IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_RET, messageBuff);
>>>
>>> -Rick
>>
|
|
|
Re: console output under Windows [message #34540 is a reply to message #34536] |
Wed, 26 March 2003 12:59  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Bill Atkins" wrote
...
> This doesn't quite do it for my case. Some of the routines where
> I'd like to put print statements are in a DLL built from c++,
> called by a DLM C routine. (export.h didn't compile with c++.)
What version of IDL?
I've created a few simple C++ DLMs w/o incident. Can you just create a
single C++ DLM compiled with export.h?
-Rick
>
> Bill
>
> Rick Towler wrote:
>
>> "Bill Atkins" wrote in message
>>
>>> Is there a way to get console output on Windows? I.e. the output from
>>> printf statements in a C DLM routine.
>>
>> You mean something like this?
>>
>> sprintf(messageBuff, "input values: %f %f %f",data[0], data[1],
data[2]);
>> IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_RET, messageBuff);
>>
>> -Rick
>
|
|
|
Re: console output under Windows [message #34542 is a reply to message #34540] |
Wed, 26 March 2003 11:54  |
Bill Atkins
Messages: 3 Registered: March 2003
|
Junior Member |
|
|
This doesn't quite do it for my case. Some of the routines where I'd like to
put print statements are in a DLL built from c++, called by a DLM C routine.
(export.h didn't compile with c++.)
Bill
Rick Towler wrote:
> "Bill Atkins" <atkins@lanl.gov> wrote in message
>
>> Is there a way to get console output on Windows? I.e. the output from
>> printf statements in a C DLM routine.
>
> You mean something like this?
>
> sprintf(messageBuff, "input values: %f %f %f",data[0], data[1], data[2]);
> IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_RET, messageBuff);
>
> -Rick
|
|
|
Re: console output under Windows [message #34544 is a reply to message #34542] |
Wed, 26 March 2003 10:08  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Bill Atkins" <atkins@lanl.gov> wrote in message
> Is there a way to get console output on Windows? I.e. the output from
> printf statements in a C DLM routine.
You mean something like this?
sprintf(messageBuff, "input values: %f %f %f",data[0], data[1], data[2]);
IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_RET, messageBuff);
-Rick
|
|
|