[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | DECC |
Notice: | General DEC C discussions |
Moderator: | TLE::D_SMITH N TE |
|
Created: | Fri Nov 13 1992 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 2212 |
Total number of notes: | 11045 |
2210.0. "LINK-W-USEUNDEF" by ZPOVC::NWE () Wed Jun 04 1997 05:33
Hi
Customer is having problem with linking of C program (pls see below).
Any advise or pointers are welcome.
regards,
Nwe
Alpha OPEN VMS 6.2 DEC C 5.2
ZPOTS5$NWE %$ type test.c
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
#include<time.h>
#include<fcntl.h>
/*int putenv(const char*);
void tzset(void);
*/
main()
{
char* a;
a="tz=est%edt";
printf("%d\n",putenv(a));
tzset();
}
ZPOTS5$NWE %$ cc/prefix_library_entries=all_entries test
printf("%d\n",putenv(a));
..............^
%CC-I-IMPLICITFUNC, In this statement, the identifier "putenv" is implicitly dec
lared as a function.
at line number 16 in file SYS$SYSROOT:[SYSMGR]TEST.C;1
tzset();
^
%CC-I-IMPLICITFUNC, In this statement, the identifier "tzset" is implicitly decl
ared as a function.
at line number 17 in file SYS$SYSROOT:[SYSMGR]TEST.C;1
If the program is the same with two functions "putenv" and "tzset" declared
explicitly,
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
#include<time.h>
#include<fcntl.h>
int putenv(const char*);
void tzset(void);
main()
{
char* a;
a="tz=est%edt";
printf("%d\n",putenv(a));
tzset();
}
$cc/prefix_library_entries=all_entries test
there is no compliation error as I have explicitly declared the two functions.
$ link test
%LINK-I-UDFSYM, PUTENV
%LINK-I-UDFSYM, TZSET
%LINK-W-USEUNDEF, undefined symbol PUTENV referenced
in psect $LINK$ offset %X00000040
in module TEST file SYS$SYSROOT:[SYSMGR]TEST.OBJ;2
%LINK-W-USEUNDEF, undefined symbol TZSET referenced
in psect $LINK$ offset %X00000050
in module TEST file SYS$SYSROOT:[SYSMGR]TEST.OBJ;2
T.R | Title | User | Personal Name | Date | Lines |
---|
2210.1 | | TLE::D_SMITH | Duane Smith -- DEC C RTL | Wed Jun 04 1997 07:39 | 11 |
| You are using functionality that was added in OpenVMS V6.2. You have
two choices:
o require OpenVMS V7.0 and above
o use the backport object library shipped with DEC C V5.6
Information on the object library is available on the CRTL home page
http://hndymn.zko.dec.com/crtl
Duane
|
2210.2 | a fake putenv is pretty mindless... | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Wed Jun 04 1997 10:56 | 11 |
| : ... You have two choices:
Three choices....
o Use a local variation of putenv (my_putenv) that calls
lib$set_symbol or lib$set_logical. (This is a pretty
mindless routine to create...)
This avoids the OpenVMS V7.0 version requirement, and avoids
the need for the V5.6 `backport' library...
|
2210.3 | | TLE::D_SMITH | Duane Smith -- DEC C RTL | Wed Jun 04 1997 11:35 | 3 |
| Maybe Steve could conjure up a mindless tzset() while he's at it...
8-)
|
2210.4 | Adventures in Porting Code... | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Wed Jun 04 1997 14:51 | 12 |
|
: Maybe Steve could conjure up a mindless tzset() while he's at it...
one can use the UTC-related system service calls and associated LIB$ calls,
depending on what one is up to. (These services are available in OpenVMS
V6.0 and later.) Not quite as mindless as putenv, but -- for the basic
cases, at least -- not really that difficult, either...
One might end up hacking a few other time-related C calls...
Want me to whip out those locking routines while I'm at it, Duane? :-)
|