[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
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

2208.0. "Question on Floating Point and Link Option" by DEKVC::JOONGSUNJUN () Tue Jun 03 1997 05:06

    Hi,

    Please inform me on questions about floating point and link option.

    (1)  Environment

	 -  Alpha/OpenVMS V6.2-1H3
	 -  DEC C V5.3-006 

    (2)  Question about floating point data type and linking

	 $ cc tst01	!  use default floating point, G_FLOAT.
			!  tst01.c has several variables whose data
			!    type is double.

	 $ lin tst01	!  did not link with sys$library:vaxcrtl.olb.
			!  did not define any lnk$library.

	 (*)  According to $ help cc/float, each .C program should be linked
	      with corresponded vaxcrtl*.olb by defined floating point.

	 Please inform me

	 2-1)  whether missing vaxcrtl.olb will make errors,
	       while tst01.exe processes data whose data type is double.

	 2-2)  about correct linking option for each floating qualifier
	       at compile time.

    (3)  Question about COBOL and C

	 $ cob main01	!  main01 calls sub01 as a sub-program.
			!  main01 and sub01 use d_float data type

	 $ cc sub01/float=d_float

	 $ lib/ins user$lib sub01	!  sub01 inserted into user's object
					!  library

	 $ lin main01,user$lib		!  did not link with sys$library:
					!    vaxcrtld.olb.
					!  did not define any lnk$library
	 Please inform me

	 3-1)  whether missing vaxcrtld.olb will make errors, while 
	       main01.exe calls sub01 and it processes data whose data type
	       is double.

	 3-2)  if this procedure has problem, please advise me what correct
	       procedure is.

    Best Regards,
    Joong-Sun Jun.
T.RTitleUserPersonal
Name
DateLines
2208.1Looks good, what's the problem?WIBBIN::NOYCEPulling weeds, pickin' stonesTue Jun 03 1997 11:202
With DEC C you should never need to use VAXCRTL or VAXCRTLG.
It looks like the procedure you're using is entirely correct.
2208.2The rest of the help fileCXXC::REPETERich Peterson 381-1802 ZKO2-3/N30Tue Jun 03 1997 15:0327
RE .1:

> According to $ help cc/float, each .C program should be linked
> with corresponded vaxcrtl*.olb by defined floating point.

According to help cc/float on OpenVMS Alpha, this description
has two major qualifications attached to it:

     1. If you are linking against object-module libraries
     2. and /PREFIX=ALL is not specified on the command line

Your cc command did not specify /prefix=all, but then again your
link command did not specify object libraries to link against.
So the linker used the DECC RTL sharable image.  Although your
program contained double variables, it apparently did not call
any DECC RTL routines that handle double values that are not
specified as part of the ANSI C standard library.  Therefore
all of the RTL calls got prefixed with DECC$ and mapped to
the specific routines that handle G-float.

If your program had called a non-standard routine, such as hypot(),
then you would have gotten an unresolved reference that would be cured
by compiling with /prefix=all.  It is only if you "refuse" to
compile with /prefix=all and also call non-ANSI routines that
deal with floating point values that you would need to link with
these object libraries.  That is not something you would normally
want to do.
2208.3Thank youDEKVC::JOONGSUNJUNWed Jun 04 1997 04:186
    Hi,
    
    I thank you for your help.
    
    Best Regards,
    Joong-Sun Jun.