Re: WOW, What's wrong with 4GL
Posted in 1996
In article <4uoaa9$ua@globe.indirect.com>, Paul Carlton
<pronet03@indirect.com> writes
>Someone please help, we are trying to port all of our Informix
>4gl code from Sun0S 4.1.3 to Solaris 2.5. Our esql/c programs
>have showed no problems on the porting, but our 4gl programs
>have..
>
>Take this case using static libraries, on 4.1.3, it works, but
>here's what happens with Solaris 2.5:
>
>theron->./c4gl test.4gl -static -o ./test
>cc -I/usr1/informix/incl/tools -I/usr1/informix/incl/esql test.c -o
>./test -L/usr1/informix/lib/tools -l4gl -lnforms -lfesql -los -lasf
>/usr1/informix/lib/tools/netlib.a -los -lasf -lgen -lnsl -lsocket -lm
>-ltermlib
>theron->./test
>This is a test
>ARG= -1
>NO arg
>Segmentation Fault (core dumped)
>
>
>And here's the code:
>MAIN
>
>DEFINE tsr_id CHAR(6),
> arg_no INTEGER
>
>DISPLAY "This is a test"
>
>LET arg_no = 0
>LET arg_no = num_args()
>DISPLAY "ARG= ", arg_no
>
>IF arg_no > 0
>THEN
> DISPLAY "arg in"
>
> LET tsr_id = arg_val(1)
> DISPLAY "tsr_id = ", tsr_id
>ELSE
> DISPLAY "NO arg "
>END IF
>
>
>END MAIN
>
>
>1. Why would it core dump at 'END MAIN'?
Strange, does not seem coorect to me - try putting a display right
before the END MAIN and see what happens.
>2. Why would 'num_args()' return -1 even though we passed
> arguments??
>
>---------------
>
Again seems very wierd.
>c4gl, just to compile this program, takes over 90 seconds before
>it finishes the compile... On the SunOS 4.1.3 platform, it will take
>about 2-3 seconds...
>
>---------------
90 seconds is far too long - something is wrong at the UNIX level.
>
>Problem 3: (THE BIGGIE)
>
>When we try and run our commercial application (Compiled with a
>'static' library), we get the following:
>theron->./protel.4ge
>Program stopped at "SLIB/main.4gl", line number 16.
>4GL run-time error number -25588.
>The appl process cannot connect to OnLine server online_dev.
>theron->
>
>
>The line that it happens on in the .4gl is immediately following
>'MAIN'... There are NO statements, so it's trying to execute some
>informix start-up routine and we are getting the message there...
>
Sounds as if main.4gl has a DATABASE <foo> statement or similar at
the top outside of any function.
If this is outside of any function then it is a complier directive
defining where a to find the table definition in a DEFINE statement:-
DEFINE <variable> LIKE <table>.column
DEFINE <variable. RECORD LIKE <table>.*
If it is outside any function AND also in the .4gl file file which
contains MAIN then IN ADDITION before main is entered the 4gl
connects to the database in the DATABASE <foo> statement.
>The other day, I tried to use 'c4gl -shared' to use a shared library
>instead and low and behold, we did NOT get the above error message.
>
Sounds as if your environment was different or the database server
was up at the time.
>So it only happens with 'static' libraries... Something is definitely
>very wrong.
>
Doesn't sound right, try doing isql <database> or dbaccess
<database> before compiling at check you can connect to the
database.
>When we use shared libraries, we STILL get 'Problem #1'...
>
>------------------
>
>Informix Technical Support has not given us the proper help needed in
>solving these 3 problems, so we are left 'guessing' and grabbing
>at straws!!
>
>Anyone else have any ideas...
>
>thanks again,
>
>MIS, Promark One
>
>
Which version of 4GL/engine are you using and what are you enviroment
variables set to?
--
David Williams