Tackling COMPILATION ERRORS

Tackling COMPILATION ERRORS

Problem:

  • Product Name: VisiBroker for C++
  • Product Version: 5.2 and above
  • Product Component : ORB
  • Platform/ OS version: All

Errors compiling C++ source created by idl2cpp tool

This article shall help in dealing with errors faced during the compilation of C++ source created by idl2cpp tool.

Resolution:

A. First of all, please verify that you are using a supported compiler. E.g. for VBC7.0 you can check the following link:

VisiBroker 7.0 Platform Release Availability

B. Secondly, you can try building the .../basic/bank_agent example in VBC installation directory in the same environment where you are building your application. Once you are able to run the example, that will ensure that your test environment is proper, so next step is to check the compilation flags.


C. In the stdmk file (usually found in <VBROKERDIR>/examples directory), you can found out what are the requisite compilation flags for your application environment. It would be listed under the comment starting with "###Compiler flags".

1) E.g. on HP-UX 11, you will find the following script in stdmk:

### Compiler flags for debug

## 32 bit Multithreaded options

#CCFLAGS = $(CCFLAGS1) $(CCINCLUDES) $(DEBUG) -DINCLUDE_FSTREAM -D_REENTRANT -D_KERNEL_THREADS -D_THREAD_SAFE -DTHREAD -D_VIS_LONG_LONG -D_VIS_LONG_DOUBLE -D_VIS_UNICODE -D_VIS_STREAM_WCHAR -D_VIS_NO_IOSTREAM_WCHAR -D_VIS_NO_IOSTREAM_LONGDOUBLE +W1039

2) If you miss any requisite compilation flag, it may result in compilation errors. For example, it is observed that the C++ source created by VB7.0 idl2cpp tool, doesn't compile on Solaris 10 with platform native compiler.

Following are the errors reported during make (VBC7.0 on Solaris 10):

Compiling ASN1Limits_c.cc
 "/opt/Borland/VisiBroker/include/poa_c.hh", line 596: Warning: PortableServer_POA::_release Hides the virtual function CORBA_LocalObject::_release() in a virtual base.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 146: Error: "," expected instead of "_dict_mtx".
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 147: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 147: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 149: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 197: Error: "," expected instead of "_dict_mtx".
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 198: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 198: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 199: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 220: Error: "," expected instead of "_dict_mtx".
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 221: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 221: Error: Use ";" to terminate declarations.
 "/opt/Borland/VisiBroker/include/vtcimp.h", line 222: Error: Use ";" to terminate declarations.
 12 Error(s) and 1 Warning(s) detected.
 make[1]: *** [ASN1Limits_c.o] Error 12
 make[1]: Leaving directory `/alcatel/home/js/DEV/NMS/rexus/src/rexusG2R5/generated"
 make: *** [all] Error 1

The "vtcimp.h" refers to simple and recursive mutexes which are implemented using the appropriate native primitives available on different OSes. On Solaris, this requires two flags -DTHREAD -DSOLARIS to be added as part of compiler definitions. So, these flags are to be included when you compile on Solaris. In stdmk, these would be mentioned as CC Flags.

 

 

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 20:09
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.