<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calling C++ from HP Pascal in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-c-from-hp-pascal/m-p/3112420#M717575</link>
    <description>It depends. The most common problems surround global constructors and destructors which depend upon _main(). Look in /opt/aCC/html/C/guide for otherlangs.htm. Here is an excerpt from that file:&lt;BR /&gt;---------------&lt;BR /&gt;The main() Function&lt;BR /&gt;&lt;BR /&gt;In general, when mixing C++ modules with modules in HP Pascal and HP FORTRAN 90, the overall control of the program must be written in C++. In other words, the main() function must appear in some C++ module and no other outer block should be present. &lt;BR /&gt;&lt;BR /&gt;If you wish to have a main() function in a module other than a C++ module, you can add a call to _main() as the first non-declarative statement in the module. However, if you use this method, your code is not portable. &lt;BR /&gt;------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You will find that you will fight far fewer battles if you make a slight change in your thinking. Make what is now you Pascal program a procedure e.g. change&lt;BR /&gt;Program My_Program&lt;BR /&gt;....&lt;BR /&gt;END.&lt;BR /&gt;&lt;BR /&gt;to&lt;BR /&gt;&lt;BR /&gt;Procedure My_Program;&lt;BR /&gt;.....&lt;BR /&gt;end; {My_Program}&lt;BR /&gt;&lt;BR /&gt;Your then have a small C++ main that calls your Pascal My_Program and you are done. It's far, far easier to link Pascal to C++ than the other way round.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 06 Nov 2003 11:25:10 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2003-11-06T11:25:10Z</dc:date>
    <item>
      <title>Calling C++ from HP Pascal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-c-from-hp-pascal/m-p/3112419#M717574</link>
      <description>I am unclear whether it is possible to call C++ routines from within HP Pascal routines.  I need information about doing it the other way around.  Is it possible?&lt;BR /&gt;&lt;BR /&gt;I get the error:&lt;BR /&gt;&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __shlinit (code)  from /usr/local/pcm170/lib&lt;BR /&gt;pcmsrv.sl                                                                       &lt;BR /&gt;&lt;BR /&gt;When I run my program...&lt;BR /&gt;&lt;BR /&gt;Any info GREATLY appreciated.&lt;BR /&gt;&lt;BR /&gt;Chris Irwin&lt;BR /&gt;coi@cirwin.com</description>
      <pubDate>Thu, 06 Nov 2003 10:56:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-c-from-hp-pascal/m-p/3112419#M717574</guid>
      <dc:creator>Chris Irwin</dc:creator>
      <dc:date>2003-11-06T10:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calling C++ from HP Pascal</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-c-from-hp-pascal/m-p/3112420#M717575</link>
      <description>It depends. The most common problems surround global constructors and destructors which depend upon _main(). Look in /opt/aCC/html/C/guide for otherlangs.htm. Here is an excerpt from that file:&lt;BR /&gt;---------------&lt;BR /&gt;The main() Function&lt;BR /&gt;&lt;BR /&gt;In general, when mixing C++ modules with modules in HP Pascal and HP FORTRAN 90, the overall control of the program must be written in C++. In other words, the main() function must appear in some C++ module and no other outer block should be present. &lt;BR /&gt;&lt;BR /&gt;If you wish to have a main() function in a module other than a C++ module, you can add a call to _main() as the first non-declarative statement in the module. However, if you use this method, your code is not portable. &lt;BR /&gt;------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You will find that you will fight far fewer battles if you make a slight change in your thinking. Make what is now you Pascal program a procedure e.g. change&lt;BR /&gt;Program My_Program&lt;BR /&gt;....&lt;BR /&gt;END.&lt;BR /&gt;&lt;BR /&gt;to&lt;BR /&gt;&lt;BR /&gt;Procedure My_Program;&lt;BR /&gt;.....&lt;BR /&gt;end; {My_Program}&lt;BR /&gt;&lt;BR /&gt;Your then have a small C++ main that calls your Pascal My_Program and you are done. It's far, far easier to link Pascal to C++ than the other way round.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Nov 2003 11:25:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-c-from-hp-pascal/m-p/3112420#M717575</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-11-06T11:25:10Z</dc:date>
    </item>
  </channel>
</rss>

