# Natural Userexit in C++ on SLES 10

**URL:** <https://techcommunity.softwareag.com/t/natural-userexit-in-c-on-sles-10/78765>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [August 13, 2008, 6:24pm UTC](https://techcommunity.softwareag.com/t/natural-userexit-in-c-on-sles-10/78765 "2008-08-13T18:24:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Brockmann](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@Martin\_Brockmann](https://techcommunity.softwareag.com/u/Martin_Brockmann)\
**Post date:** [August 13, 2008, 6:24pm UTC](https://techcommunity.softwareag.com/t/natural-userexit-in-c-on-sles-10/78765/1 "2008-08-13T18:24:18Z")

</div>

Hallo,

trying to compile and link a Natural Userexit (coded in C++, CALL INTERFACE4) in Natural 6.3.4 on SLES 10 I found a hint in the documentation to use gcc 3.3.

The installed gcc version on SLES 10 is currently 4.1.2; so the compiled and linked Natural-ELF references “libstdc++.so.6” (in contrast to “libstdc++.so.5” which has been used by delivered Natural ELFs). Starting the application with the ambiguous use of c+±library references (libstdc++.so.5 and(!) libstdc++.so.6) it abended due to an invalid pointer referenced by class destructor :shock:.

There was a forum entry for RedHat 5 to install the “compat”-RPMs (compat-gcc-33 and compat-libstdc+±33) in order to use the “old” gcc 3.3, but I can’t find any RPMs which have been released for SLES 10 with the required functionality.

Questions:

:?: Are there any “compat”-packages for SLES 10?  
:?: If not: which is the recommended way to compile and link Natural-Userexits without incompatible use of C++ runtime libraries?

Martin

---

<div class="post-metadata">

**Author:** ![Martin\_Brockmann](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@Martin\_Brockmann](https://techcommunity.softwareag.com/u/Martin_Brockmann)\
**Post date:** [June 3, 2009, 6:48pm UTC](https://techcommunity.softwareag.com/t/natural-userexit-in-c-on-sles-10/78765/2 "2009-06-03T18:48:25Z")

</div>

Hello,

actually we use Natural 6.3.5 on SLES 10 and the documentation gives a new advice concerning the usability of the different gcc versions:

“The delivered Natural for UNIX was built and tested with the compilers listed below. When relinking Natural during the installation or using the make command, we strongly recommend that you use the same compiler version.  
Linux  
SUSE Linux Enterprise Server 9: gcc 3.3”

“Additional tests were done without problems with Natural for UNIX relinked with the compilers listed below:  
Linux  
SUSE Linux Enterprise Server 9: gcc 3.3.3  
SUSE Linux Enterprise Server 10: gcc 4.1.2”

Nevertheless Natural 6.3.5 on SLES10 obviously is compiled with gcc 3.3 and therefore furtheron references “libstdc++.so.5”.

So my question from previous post is still up to date: Why isn’t Natural 6.3.5 compiled with gcc 4.x (which is the default compiler for SLES10) and therefore why doesn’t it reference the newer “libstdc++.so.6” in order to avoid the named ambiguous use of different C++ runtime libraries?

Kind regards  
Martin

---

<div class="post-metadata">

**Author:** ![Thomas\_Schenker1](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@Thomas\_Schenker1](https://techcommunity.softwareag.com/u/Thomas_Schenker1)\
**Post date:** [June 8, 2009, 5:16pm UTC](https://techcommunity.softwareag.com/t/natural-userexit-in-c-on-sles-10/78765/3 "2009-06-08T17:16:34Z")

</div>

Hello,

Natural is compiled with gcc 3.3 for compatibility reasons.  
So it is possible to use the same kit on almost all current SUSE/Redhat  
Platforms. This means that a customer can have Natural Installations  
on different SUSE/Redhat Platforms without worrying about any compatibility problems.

From your last post it looks like you are trying to link your userexit static  
to the natural nucleus. Have you tried to build the userexit as shared  
library? Normally this should work, because the shared library can have its own libstdc++.

Regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:50pm UTC](https://techcommunity.softwareag.com/t/natural-userexit-in-c-on-sles-10/78765/4 "2021-04-02T14:50:45Z")

</div>


