📄 pgqa.gml
字号:
.code break
double precision function __math2err( err_info, arg1, arg2 )
integer err_info
double precision arg1, arg2
include 'mathcode.fi'
arg1 = arg1 ! to avoid unreferenced warning message
arg2 = arg2 ! to avoid unreferenced warning message
.code break
if( ( err_info .and. M_DOMAIN ) .ne. 0 )then
select( err_info .and. FUNC_MASK )
case( FUNC_SQRT )
print *, 'argument cannot be negative'
case( FUNC_ASIN, FUNC_ACOS )
print *, 'argument must be less than or equal to one'
case( FUNC_ATAN2 )
print *, 'both arguments must not be zero'
case( FUNC_POW )
if( arg1 .eq. 0.0 )then
print *, 'a zero base cannot be raised to a ',
& 'negative power'
else ! base < 0 and non-integer power
print *, 'a negative base cannot be raised to a ',
& 'non-integral power'
endif
case( FUNC_LOG, FUNC_LOG10 )
print *, 'argument must not be negative'
end select
.code break
else if( ( err_info .and. M_SING ) .ne. 0 )then
if( ( ( err_info .and. FUNC_MASK ) .eq. FUNC_LOG ) .or.
& ( ( err_info .and. FUNC_MASK ) .eq. FUNC_LOG10 ) )then
print *, 'argument must not be zero'
endif
.code break
else if( ( err_info .and. M_OVERFLOW ) .ne. 0 )then
print *, 'value of argument will cause overflow condition'
.code break
else if( ( err_info .and. M_UNDERFLOW ) .ne. 0 )then
print *, 'value of argument will cause underflow ',
& 'condition - return zero'
end if
__math2err = 0
end
.code break
complex function __zmath2err( err_info, arg1, arg2 )
integer err_info
complex arg1, arg2
include 'mathcode.fi'
arg1 = arg1 ! to avoid unreferenced warning message
arg2 = arg2 ! to avoid unreferenced warning message
.code break
if( ( err_info .and. M_DOMAIN ) .ne. 0 )then
select( err_info .and. FUNC_MASK )
case( FUNC_POW )
! arg1 is (0,0)
if( imag( arg2 ) .ne. 0 )then
print *, 'a zero base cannot be raised to a',
& ' complex power with non-zero imaginary part'
else
print *, 'a zero base cannot be raised to a',
& ' complex power with non-positive real part'
endif
end select
end if
__zmath2err = (0,0)
end
.code break
double complex function __qmath2err( err_info, arg1, arg2 )
integer err_info
double complex arg1, arg2
include 'mathcode.fi'
arg1 = arg1 ! to avoid unreferenced warning message
arg2 = arg2 ! to avoid unreferenced warning message
if( ( err_info .and. M_DOMAIN ) .ne. 0 )then
select( err_info .and. FUNC_MASK )
case( FUNC_POW )
! arg1 is (0,0)
if( imag( arg2 ) .ne. 0 )then
print *, 'a zero base cannot be raised to a',
& ' complex power with non-zero imaginary part'
else
print *, 'a zero base cannot be raised to a',
& ' complex power with non-positive real part'
endif
end select
end if
__qmath2err = (0,0)
end
.code end
.*
.do end
.*
.if '&lang' eq 'FORTRAN 77' .do begin
.*
.section The compiler cannot find my include files
.*
.np
.ix 'message' 'unable to find files'
.ix 'unable to find files'
.ix 'message' 'include files'
.ix 'files' 'unable to find'
In order to locate your INCLUDE files, the compiler first searches
your current directory, then each directory listed in the
.ev &incvarup
environment variable (in the order that they are specified).
If the compiler reports that it is unable to find one of your include
files, change the
.ev &incvarup
environment variable by adding the directory path to your include
files.
For more information on setting the environment variable, refer to the
"Compiling an Application"
.if '&target' eq 'QNX' .do begin
chapter.
.do end
.el .do begin
chapter of the
.book &cmpname User's Guide.
.do end
.*
.do end
.*
.if '&lang' eq 'C' or '&lang' eq 'C/C++' .do begin
.*
.section The compiler cannot find "stdio.h"
.*
.np
.ix 'message' 'unable to find files'
.ix 'unable to find files'
.ix 'message' 'header files'
.ix 'header files'
.ix 'files' 'unable to find'
The standard header files are usually located in the sub-directory
that the &cmpname compiler is installed in.
Suppose that the header files are located in the sub-directory
.fi &dr3.&pathnam.&hdrdir..
If the compiler indicates (through an error message) that it is unable
to locate the file
.fi STDIO.H
.ct , we have forgotten something.
There are two ways to indicate to the &cmpname compiler the location
of the standard header files.
.autopoint
.point
use the
.ev &incvarup
environment variable
.if '&target' eq 'QNX' .do begin
.point
use the "i" option (&cmpname)
.point
use the "I" option (&wclname)
.do end
.el .do begin
.point
use the "i" option (&cmpname, &wclname)
.do end
.endpoint
.np
.ix '&cmpname options' 'i'
The use of the environment variable is the simplest way to ensure that
the include files will be found.
.if '&target' eq 'QNX' .do begin
.ix 'user initialization file'
For instance, if you include the following line in your user
initialization file,
.do end
.el .do begin
.ix 'system initialization file' 'AUTOEXEC.BAT'
.ix 'AUTOEXEC.BAT' 'system initialization file'
For instance, if you include the following line in your system
initialization file,
.fi AUTOEXEC.BAT,
.do end
.millust begin
&setcmd &incvar=&dr3.&pathnam.&hdrdir
.millust end
.pc
the &cmpname compiler will be able to find the standard include files.
The use of the "i" option is another way to give the directory name of
the standard include files.
.exam begin
&prompt.&ccmd16 myfile.c -i&dr3.&pathnam.&hdrdir
or
&prompt.&ccmd32 myfile.c -i&dr3.&pathnam.&hdrdir
or
&prompt.&pcmd16 myfile.cpp -i&dr3.&pathnam.&hdrdir
or
&prompt.&pcmd32 myfile.cpp -i&dr3.&pathnam.&hdrdir
.exam end
.np
The usual manner that these methods are combined is as follows.
The
.ev &incvarup
environment variable is used to give the location of the standard C
library header files.
Any directories of header files local to a specific programming
project are often candidates for the "i" option method.
.if '&target' eq 'QNX' .do begin
See the "#include File Processing" section of the appropriate chapter.
.do end
.el .do begin
See the "&product #include File Processing" section of the chapter
entitled "The &product Compilers" in the
.book &cmpname User's Guide
for more details.
.do end
.if '&target' eq 'QNX' .do begin
Note that
.kw &wclcmd
automatically directs the compiler to include
.fi &dr3.&pathnam.&hdrdir
in its search path.
.do end
.*
.do end
.*
.if '&lang' eq 'FORTRAN 77' .do begin
.*
.section The linker reports a "stack segment not found" error
.*
.np
.ix 'message' 'stack segment not found'
.ix 'stack segment not found'
.ix 'message' 'no starting address found'
.ix 'no starting address found'
The linker usually reports the error "1014: stack segment not found"
when it is unable to find the run-time libraries required to link
your application.
To ensure you are linking with the correct run-time libraries,
check to see that your link command contains the correct "SYSTEM"
directive.
As well, the
.ev &pathvarup.
environment variable should be pointing to the directory containing
the &cmpname software.
For a &cmpname application, if this error is followed by the error
"1023: no starting address found", it may indicate that you are
attempting to link code that does not have a main program
procedure.
Ensure that you include your main program object module with your
linker directives.
.np
With &lang, "STACK" is a reserved word.
If you use "STACK" as the name of a common block, this may also result
in the "Stack Segment Not Found" error.
Check the names of your common blocks and rename them if necessary.
.*
.do end
.*
.section Resolving an "Undefined Reference" linker error
.*
.np
.ix 'linker' 'undefined references'
.ix 'message' 'undefined references'
.ix 'undefined references'
The &lnkname builds an executable file by a process of resolving
references to functions or data items
that are declared in other source files.
Certain conditions arise that cause the linker to generate an
"Undefined Reference" error message.
An "Undefined Reference" error message will be displayed by the linker
when it cannot find a function or data item that was referenced in
the program.
Verify that you have included all the required object modules in the
linker command and that you are linking with the correct libraries.
.*
.if '&lang' eq 'FORTRAN 77' .do begin
.np
.ix 'system'
.ix 'library'
The "SYSTEM" linker directive should be used to indicate the target
environment for the executable.
This directive specifies the format of the executable and the
libraries for the target environment.
Verify that the
.ev &pathvarup.
environment variable is set to the directory that &cmpname was
installed in since it is used to complete the library path in the
"SYSTEM" directive.
You may also explicitly include a library using the "LIBRARY" linker
directive.
.np
.ix 'undefined references' '_cstart_'
.ix '_cstart_'
If the linker reports an unresolved reference for "_cstart_", this
indicates that the linker could not find the &lang run-time libraries.
.*
In 16-bit applications, the &lang run-time libraries for the medium
memory model (/mm) and the floating-point calls floating-point model
(/fpc) would be
.fi flibm.lib.
In 32-bit applications, the &lang run-time libraries for the flat
memory model would be
.fi flib.lib.
Verify that the "LIB" environment variable has been set to point to
the correct
.ev &pathvarup.
library directories and that the library corresponds to the memory and
floating-point model that you selected.
.do end
.*
.if '&lang' eq 'C' or '&lang' eq 'C/C++' .do begin
.ix '_cstart_'
There are a couple of "undefined references" that require some
explanation.
.begnote
.mnote _cstart_
The unresolved reference for
.ix 'undefined references' '_cstart_'
.ix '_cstart_'
.id _cstart_
indicates that the linker cannot find the &lang run-time libraries.
.*
The 16-bit C run-time libraries for the small memory
model are
.fi clibs.lib
and, either
.fi maths.lib,
or
.fi math87s.lib.
The 32-bit C run-time libraries for the flat memory model
compiled for the register-based argument passing model are
.fi clib3r.lib
and, either
.fi math3r.lib,
or
.fi math387r.lib.
Ensure that the
.ev &pathvarup.
environment variable is set to the directory that &cmpname
was installed in.
.ix 'undefined references' '_fltused_'
.ix '_fltused_'
.mnote _fltused_
The
.id _fltused_
undefined reference indicates that floating-point arithmetic has
been used in the modules that exhibit this error.
The remedy is to ensure that the linker can find the appropriate math
library.
For the 16-bit small memory model, it is either
.fi maths.lib,
or
.fi math87s.lib
For the 32-bit register-based argument passing model, it is either
.fi math3r.lib,
or
.fi math387r.lib
depending on which floating-point option is used.
Ensure that the
.ev &pathvarup.
environment variable is set to the directory that &cmpname
was installed in.
.ix 'undefined references' '_small_code_'
.ix '_small_code_'
.mnote _small_code_
If this undefined reference occurs when you are trying to create a
16-bit application, we have saved you many hours of debugging!
The reason for this undefined reference is that the "main" entry
point has been compiled for a big code model (in any one of medium,
large, or huge memory models).
Any of the modules that have this undefined reference have been
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -