Article View: gnu.gcc.help
Article #42369VMS GNU C links to BASIC but C++ won't (undefined symbol)
From: Russell Salerno
Date: Fri, 15 Dec 1995 00:00
Date: Fri, 15 Dec 1995 00:00
52 lines
1843 bytes
1843 bytes
I need to glue some routines written in C++ to a VAX/VMS BASIC program.
Glue functions will interface between the C++ classes and the calling
BASIC program. The problem is that the linker does not recognize
symbols of the C++ routines, or anything compiled with the /PLUS_PLUS
qualifier.
As a test, I wrote a stub routine and compiled it using $
gcc/nocase_hack,
and it links just fine. If I compile the same routine using
$ gcc/nocase_hack/plus_plus, the link fails - the glue routine is now
undefined.
Is there a way to correct this or am I lacking some basic knowledge
here?
+-----------------+
| Russ Salerno |
| rsalerno@li.net |
+-----------------+
The C glue function stub:
-------------------------
int glue(int a, int b, int c) {
return 999;
}
The VAX/VMS BASIC caller:
-------------------------
external long function glue(long, long, long)
declare long l$_test
l$_test = glue(1,2,3)
print l$_test
end
The problem:
------------
$ gcc/debug/noopt/nocase glue.c
$ lin test,glue
$ run test
999
$ gcc/debug/noopt/nocase/plus glue.c
$ lin test,glue
%LINK-W-NUDFSYMS, 1 undefined symbol:
%LINK-I-UDFSYM, GLUE
%LINK-W-USEUNDEF, undefined symbol GLUE referenced
in psect $CODE offset %X00000036
in module TEST$MAIN file DKA700:[RUSS]TEST.OBJ;9
Technical Details
Message-ID:
<4ass54$766@linet02.li.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,875bb85a4c10552,start X-Google-Attributes: gid11318c,public From: rsalerno@linet01.li.net (Russell Salerno) Subject: VMS GNU C links to BASIC but C++ won't (undefined symbol) Date: 1995/12/15 Message-ID: <4ass54$766@linet02.li.net> X-Deja-AN: 121954549 x-posted-from: InterNews 1.0.6@lisuser57.li.net organization: LI Net (Long Island Network) x-authenticated: rsalerno on POP host linet01.li.net newsgroups: gnu.gcc.help