Problem:
The following compilation command fails with the error "cob64: warning: -u overrides -x"
cob -x -L/u01/oracle/db/10.2.0/lib/ -L/usr/shlib /u01/oracle/db/10.2.0/precomp/lib/cobsqlintf.o \\
-lclntsh -lnbeq10 -lnhost10 -lnus10 -lnldap10 -lldapclnt10 \\
-lnsslb10 -lntcp10 -lntcps10 -lnsslb10 -lntcp10 -lntns10 \\
-lkstat -lnsl -lsocket -lgen -ldl -lsched \\
-R/u01/oracle/db/10.2.0/lib -laio -lposix4 -lm -lthread
Resolution:
The compilation command is poorly formed, an option is specified which is not supported by the Micro Focus 'cob' command
The invalid option is the '-R' - This is an option for the UNIX link editior, When 'cob' parses the options the -R is essentially ignored, the next character captured is the 'u' which is meaningful to the cob command but is causing contention with the -x specified earlier in the command line.
Resolution and explanation of options used in compile:
-u
Compiles the COBOL source code files (.cbl, .CBL or .cob) into intermediate code and then generates them to dynamically loadable native code (generated code) files. These files have the file extension .gnt.
-x
Creates a system executable file from the files input to the cob command. The input file can be any file type except a .gnt file. By default, the name of this module is the base-name of the first object being linked. It has no extension.
Cob assumes that any unrecognized options are either input files or valid linker options to be saved and used at link time.
-R is a unrecognized option so it is saved.The next option it sees is the u
in -R/u01/oracle/db/10.2.0/lib and overrides the -x that you previously specified.
On this operating system the linker has a valid option -R.
RESOLUTION: add the -Q in front of the -R
Explanation of -Q compiler option:
Pass Option to System Linker (-Q ld_option or -Q,1 ld_option or -Q,2ld_option)
Passes the specified cob option(s) to the system linker. The Micro Focus COBOL system uses a two-pass link process to build a linked executable module to support dynamic loading and reference to C external data. Specifying -Q ld_option passes the options to both linker passes (that is, calls of the command ld). Specifying -Q,1 ld_option passes the options to only the first linker pass. Specifying -Q,2 ld_option passes the options to only the second linker pass.
You must use a separate -Q flag for each option, and any options that begin with hyphens must be enclosed in quotation marks. Use the format -Q "flag value" only where flag and value are not separate arguments, but represent one argument containing an embedded space.



