Operating System - HP-UX
1847858 Members
3406 Online
104021 Solutions
New Discussion

who can help me out of this problem

 
myohotiti
New Member

who can help me out of this problem

hi,i am new to hp-unix,and i met a problem when i compile a c source file use cc.
for some reason i modified a c source file,then used the same make file to compile this program,on hp-unix 10.2,the program runs well,just as what i want.
but when i compile it on hp-unix 11 use the same source,same make file,and same library,the compiled program runs failed.
i don't know what is wrong with it,but the compiled program is much smaller than it before.
Who can tell me how to solve it.
Thanks in advance.
Help me!
9 REPLIES 9
Juan González
Trusted Contributor

Re: who can help me out of this problem

Hi,
the smaller size of the program in HPUX 11 may be due to it is linked with shared libraries.
Perhaps the program fail because the dinamic loader doesn't find the shared libraries your program was compiled with.
What error message do you get when you run your program? Could you send it?
Could you send too the output of the commands:
in HPUX 10.20
#chatr
in HPUX 11
#ldd

Best regards
JGM
Ravi_8
Honored Contributor

Re: who can help me out of this problem

Hi,
compiler option of 11.0 will be different from 10.2. while compiling on 11.0 you have to make necessary changes in make file

never give up
myohotiti
New Member

Re: who can help me out of this problem

Thank you for your response.
When i run the program,there is no error message displayed.
Usually i run it through a shell script,and echo the result,If the program runs successfully,the script returns "success",if not,returns "failure".
And on hp-unix 11 it always echos "failure".
Here is the result of the command you said.
Any help is appreciated.

Help me!
Bill McNAMARA_1
Honored Contributor

Re: who can help me out of this problem

As a long shot, try -DAportable
or -Dportable as part of the cc options.
It worked for me once with some gnu code.

La
It works for me (tm)
Juan González
Trusted Contributor

Re: who can help me out of this problem

Hi,
I suppose that in 10.20 you have Informix in /opt/informix and in 11.00 you have Informix in /informix.

Try this (in 11.00):
$chatr +s enable
$export SHLIB_PATH=$SHLIB_PATH:/informix/lib:/informix/lib/esql

What we get with this is that when the program is executed the dinamic loader look in the SHLIB_PATH to find the shared libraries.

Best regards
JGM
myohotiti
New Member

Re: who can help me out of this problem

Hi,Juan
Thank you for your advice.
Unfortunately,it still doesn't work.
I can't run the command 'export',does it set the environment parameter SHLIB_PATH?
Actually,on HPUN 11.00 the SHLIB_PATH has been set as /informix/lib:/informix/lib/esql
So,what else can i do to solve this problem?
Thanks in advance.
Help me!
Juan González
Trusted Contributor

Re: who can help me out of this problem

Hi,
Why don't you try to invocate the program by hand in the same way as the script do, so you can get the error message that the program returns?
Could you send this error message?

Best regards
JGM
myohotiti
New Member

Re: who can help me out of this problem

Hi,Juan
Actually i have done what you said before,but there was no error message diaplayed.
I don't know what does it means.Do you have some good sugestion?
Help me!
Bill Thorsteinson
Honored Contributor

Re: who can help me out of this problem

Which shell are you using? export is a built in for the bourne family of shells. I don't use the shells from the
csh family so I can't help you with those. export sets the
shell variable and causes it to be exported to subshells and programs. Used alone it exports the variable. The
original sh shell wouldn't work if you tried to set the
variable while exporting it.

Check the value of $? immediately after the program fails.
This will be the error code that the program failed with.
There should be an errno.h header in the include
directories that can be used to decode the error code.

If that doesn't help check the code to see what main returns, and check for calls to exit in the code. They could cause strange (private) error codes to be returned.
On UNIX a return (error) code of 0 indicated success.
Anything else indicates an error. (You can fail for many
more reasons than you can succeed.)