[omniORB] echo example compile problems under VC++ 6.0

William H Jones enjones@lerc.nasa.gov
Tue, 11 Dec 2001 16:02:30 -0500 (EST)


Richard, et al;

  At last!  Something I think I've seen before.

  In my bitter experience, Visual Workbench keys on the file extensions
and applys a straight C compiler to the *.c file type.  Changing the
file type to *.cpp should cause it to treat the source as C++.

  I did not investigate to see whether or not you could force Workbench
to apply a C++ compiler to *.c files.  Probably there is a way, but in
the situation I was working, it seemed better to go with MicroSoft's
ordained flow.

At least, I think that's your problem....  Maybe it's something entirely
different.

Bill

--

Dr. William H. Jones
MS 5-11
NASA Lewis Research Center
21000 Brookpark Road
Cleveland, OH 44135

216 433 5862
Preferred:  William.H.Jones@grc.nasa.gov
Hard code:  enjones@witsend.grc.nasa.gov
Personal:   whjones@apk.net

Project Integration Architecture:
  http://www.grc.nasa.gov/WWW/price000/index.html

No man is so fortunate but that, at the hour of his doom,
he will not have at least a few about him who are pleased
with the proceedings.
    -- Marcus Aurelius



> From owner-omniorb-list@uk.research.att.com Tue Dec 11 15:55 EST 2001
> Subject: [omniORB] echo example compile problems under VC++ 6.0
> To: omniorb-list@uk.research.att.com
> From: "Richard S Benson" <rsbenson@west.raytheon.com>
> Date: Tue, 11 Dec 2001 13:12:41 -0700
> X-MIMETrack: Serialize by Router on RWSMTA20/SRV/Raytheon/US(Release 5.0.8 |June 18, 2001) at
>  12/11/2001 01:12:42 PM
> MIME-Version: 1.0
> X-Loop: omniorb-list@uk.research.att.com
> 
> I recently downloaded omniorb and am having trouble compiling the echo
> example under VC++ 6.0.  The examples work fine using omniorb's makefiles,
> but when I try compiling eg1.c (as provided by omniorb), I get the
> following errors.
> 
> Compiling...
> eg1.c
> d:\swapps\omniorb\omni\include\omnithread.h(42) : error C2061: syntax error : identifier 'omni_mutex'
> d:\swapps\omniorb\omni\include\omnithread.h(42) : error C2059: syntax error : ';'
> d:\swapps\omniorb\omni\include\omnithread.h(43) : error C2061: syntax error : identifier 'omni_condition'
> d:\swapps\omniorb\omni\include\omnithread.h(43) : error C2059: syntax error : ';'
> d:\swapps\omniorb\omni\include\omnithread.h(44) : error C2061: syntax error : identifier 'omni_semaphore'
> d:\swapps\omniorb\omni\include\omnithread.h(44) : error C2059: syntax error : ';'
> d:\swapps\omniorb\omni\include\omnithread.h(45) : error C2061: syntax error : identifier 'omni_thread'
> d:\swapps\omniorb\omni\include\omnithread.h(45) : error C2059: syntax error : ';'
> d:\swapps\omniorb\omni\include\omnithread\nt.h(40) : error C2059: syntax error : 'string'
> d:\swapps\omniorb\omni\include\omnithread.h(180) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(180) : error C2085: 'omni_thread_fatal' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(180) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(192) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(192) : error C2085: 'omni_thread_invalid' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(192) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(201) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(201) : error C2085: 'omni_mutex' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(201) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(244) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(244) : error C2085: 'omni_mutex_lock' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(244) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(262) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(262) : error C2085: 'omni_condition' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(262) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(312) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(312) : error C2085: 'omni_semaphore' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(312) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(343) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(343) : error C2085: 'omni_semaphore_lock' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(343) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(361) : error C2054: expected '(' to follow 'class'
> d:\swapps\omniorb\omni\include\omnithread.h(361) : error C2085: 'omni_thread' : not in formal parameter list
> d:\swapps\omniorb\omni\include\omnithread.h(361) : error C2143: syntax error : missing ';' before '{'
> d:\swapps\omniorb\omni\include\omnithread.h(532) : error C2143: syntax error : missing '{' before ':'
> d:\swapps\omniorb\omni\include\omnithread.h(532) : error C2059: syntax error : ':'
> d:\swapps\omniorb\omni\include\omniorb3\corba_sysdep.h(429) : fatal error C1189: #error :  "Cannot use this C++ header file for non C++ programs."
> Error executing cl.exe.
> 
> echotest.exe - 36 error(s), 0 warning(s)
> 
> 
> 
> 
> I can't figure out what the problem is.  I imagine it's a configuration problem in Visual Studio.
> I set all of my preprocessor defines for NT4.0 and I added the omniorb include directory to the include path.
> 
> Any ideas would be much appreciated!
> 
> 
> 
> 
> 
> 
> 
>