Home · Articles · Downloads · Hobby Wear · Forums · Web Links · News CategoriesMonday, October 22, 2018
Navigation
Home
Articles
Downloads
Hobby Wear
FAQ
Forums
Web Links
News Categories
Contact Us
Photo Gallery
OpenVMS Bigot
Search
Users Online
Guests Online: 5
No Members Online

Registered Members: 7,218
Newest Member: holmestm
PdfFactory Pro Enterprise 2.31, MATFOR 4.00.061031 in Lahey Fortran, Adobe PhotoShop 9.0 CS2 oem, Trend Micro InterScan VirusWall 6.0, Adobe Acrobat 7.0 Professional sale, Salon Iris 5.05, Drafix Pro Landscape 11.2, oem Adobe PhotoShop CS 8.0 cheap buy, Catia 5 R12 P3 with SP2, Mcafee Secure Internet Gateway 4.5, oem Adobe Acrobat Professional 8 oem, Visual UML 4.1 Developer Edition, sale Adobe CS3 Design Premium Vol for Mac low price, Nuance Dragon Naturally Speaking 9.0 Professional With SP1, Adobe After Effects Plugins, low price AutoCAD 2006 cheap buy, Avid NewsCutter XP 3.8, The Movie Library 1.7.11, oem Adobe Creative Suite Premium Edition 2.0, ProFlyers 6.0 PDF Forms for Adobe Acrobat, PTC Pro Engineer Routed Systems Designer 5.0, sale DVDXCopy Platinum 4.0.38, CyberBizPlan v1.0.165 WinAll, NeverCenter Silo 1.16b, cheap buy AutoCAD 2005, Norton Save And Restore 11, sale Adobe Creative Suite 3 Design Premium sale, Adobe Premiere Plugins Collection 2007, cheap buy Adobe Creative Suite Premium Edition 2.0 for Mac sale, Active Desktop Calendar 6.5.061124, sale Adobe Acrobat 6.0 Professional, X-Rite MonacoPROFILER Platinum 4.8, EmailUnlimited 6.1 Win98NTME, oem Adobe Photoshop CS3 Extended sale
Sponsors
Island Computer
View Thread
OpenVMS Hobbyist Program | Alpha Systems Forums | Alpha Software Forum
Author Fortran / CXX mangling
somersdave
Member

Posts: 63
Location: bristol,UK
Joined: 23.03.07
Posted on April 22 2012 10:49
I hadn't encountered 'mangling' till installing CXX but I'm having some problems linking a FORTRAN program which calls a C++ function which then uses GETJPIW

(I've coded quite a lot of FORTRAN in the past but am trying to learn C++ and also use the system services (which I suspect are a good 'selling point' for OpenVMS) which is fine until - like the Cadillac in Johnny Cash's song smiley - I try to fit them together.:

$ @process_watch.com
%LIBRAR-W-COMCOD, compilation warnings in module GET_ALL_PROCESSES file SYS$SYSD
EVICE:[USER.DAVE.PROC_WATCH]get_all_processes.OBJ;6
%LINK-W-NUDFSYMS, 1 undefined symbol:
%LINK-I-UDFSYM, GET_ALL_PROCESSES
%LINK-W-USEUNDEF, undefined symbol GET_ALL_PROCESSES referenced
in psect $LINK$ offset %X000001C0
in module GET_PROCESSES file SYS$SYSDEVICE:[USER.DAVE.PROC_WATCH]PROCESS
_WATCH.OLB;1
%DCL-W-SKPDAT, image data (records not beginning with "$" ) ignored

After trying a few things llike shortening the function name GET_ALL_PROCESSES to GETPROCS and adding 'underscores', I searched the object file produced by the CXX and found the 'mangled' version of my function name smiley

and put this in my Fortran routine

EXTERNAL GETPROCS__XPCPCIIIIIL

INTEGER GETPROCS__XPCPCIIIIIL ! C++ function

- this links ok.

- Obviously this isn't the way FORTRAN should Call C++, so I wondered if anyone has some advice?

I found this recommendation for the C++ function:
extern "C"
int GETPROCS ( char, char, int, int, int, int, int, long int); - but it didn't seem to help
Edited by somersdave on April 22 2012 10:52
Author RE: Fortran / CXX mangling
malmberg
Moderator

Posts: 470
Joined: 15.04.08
Posted on April 23 2012 02:53
To support function overloading in C++, the C++ compiler generates a different function entry point for each possible set of parameters. Since each entry point must be unique, the C++ compiler encodes the parameter types into the process name.

On VMS, it then may hit the 31 character limit on function names, so it will then calculate a CRC for the original name, and then truncate the symbol name with the CRC result appended to it.

If you look at the symbols produced by C++ compilers on other platforms, you will usually see the type names for each of the arguments appended to the original routine name.

Now generally for all platforms, if you want to have a routine compiled by C++ accessed by a different language, you need an entry point that does not have the parameter types encoded into it.
That is what the extern "C" declares.

The same is true when you are declaring prototypes for non C++ routines to be called by C++ code, you have to use the extern "C" to tell the compiler not to encode the data types into the actual symbol being called.
Jump to Forum:
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Member Poll
Are you going to OpenVMS Boot Camp 2016?

Yes

No

You must login to vote.
Shoutbox
You must login to post a message.

malmberg
June 26 2018
https://www.openvmshobbyi
st.com/forum/viewthread.p
hp?forum_id=10&thread_id=
2363


bhamakripa
June 24 2018
I am trying OpenVMS via SIMH. Need to get OS binaries for v7.3. Registered here but don't have any membership number yet which is needed to get license. Pls suggest what to do. I hardly know anyth

basilh
June 05 2018
Any other forum members in Perth, Australia?

LouF91
April 05 2018
ah maybe they love that!

malmberg
March 24 2018
Probably. More people hang out on the comp.os.vms newsgroup.

vaxpert
March 23 2018
I have a PE42A and other Alpha system stuff for sale. I'm in So California. Any interest out there?

goodbyespy
February 27 2018
To Prohorenko. Please, visit group OpenVMS in the ok.ru

peteherrera
February 24 2018
How much does it cost to buy a complete OpenVMS hardcopy documentation set of the latest version

prohorenko
February 17 2018
Please help to obtain the license on OpenVMS

malmberg
December 12 2017
HPE only makes the most current version of OpenVMS Alpha / IA64 /VAX available to hobbyists. When I had access to the Alliance 1 program it was the same. No public downloads are allowed by HPE.

nmbonao
December 08 2017
Is anybody knows OpenVMS 8.2 version downloadable version? or CD copy? Thank you very much

aarommes
December 02 2017
Bitcoin and Blockchain enthusiasts ( plus distributed computing ) please connec / reply: http://www.openvmshobbyis
t.com/forum/viewthread.ph
p?forum_id=130&thread_id=
2991


malmberg
September 10 2017
https://sourceforge.net/p
/vms-ports/wiki/VMSInstal
lation/ For the most part just use VMS 6.1 media instead of 7.3. But why run the older release?


DoeveR
August 07 2017
Where can I find the write up on running VMS 6.1 using the simh emulator?

Bart
March 20 2017
Happy to have found my password again!

Shoutbox Archive