Re: Need help with command line compile.
Posted in 1994
John O'Sullivan (johno@access.isc-br.com) wrote: :Hi, :I need some help. I am new to Informix - so new I am using :Informix 4GL 1.10 and SQL 2.10. I am learning this using the Users Guide :but applying it to my own application. I am having the following question: :I compile with the following: :c4gl -a file.4gl -o gogo :It works fine and now the source file is getting huge and the compiles :are taking longer. How do I compile a module from the command line? :These modules will not have a main statement nor a database statement. :I can figure out the final compile i.e :c4gl mod1.o mod2.o mod3.o mod4.4gl -o gogo :( just like the documentation ;-)) :Note: When I tried to compile a module that refered to database fields :the compile complains and reports the following. :| :| The symbol "unstruct_name" is not the name of a column in the :| specified database. :| See error number -4322. :After I add the stmt: : :database fba :to the module I get: :> c4gl -a tryout.4gl -o tout :> /bin/ld: warning undefined symbol _main in file /lib/crt0.o :> /bin/ld: No output written This is because while linking, the MAIN ... END MAIN is not found in the module. : I cant figure out the documentation for this type of compile. : Thanks for any pointers. You can try following. Since you want to compile the modules independently, you need to have one more module say globals.4gl which will contain all global varaibles defined in your program AND a database statement for declaring the database name. You also need to include the following statement in all your modules. GLOBALS "globals.4gl" Now, you compile a single module with a command, c4gl tryout1.4gl. The database name will be picked from the globals.4gl. Do not give -o option now as it is used to produce an executable file. When all modules are compiled successfully, link them and create an executable by issuing the command, c4gl tryout1.o tryout2.o tryout3.o -o tout. Make sure that the main calling/controlling module has MAIN ... END MAIN. Regards. - Rajhans. -------------------------------------------------------------------- Rajhans G Tawde Internet: raj@shack.csci.csc.com CSC Intelicom Voice : (303) 643 1476 116 Inverness Drive East Fax : (303) 792 0319 Englewood, CO 80112 Standard Disclaimers Apply. --------------------------------------------------------------------