Operating System - Linux
1753797 Members
8420 Online
108805 Solutions
New Discussion юеВ

compiling problem in Perl module in HP UNIX 11i

 
CA1490051
Frequent Advisor

compiling problem in Perl module in HP UNIX 11i

Hi all,

We have installed avtive perl 5.8.8 in HP UNIX 11i machine.

This is the thread which was closed explicitly by HP i didnt understood why it was closed.

Any how i am posting it with different subject line.

I want to call a perl subroutine from my C/C++ code.

For this i tried perldoc perlembed,

There is a good man page available there.
i am using the cc command given in that

but if i try to compile the code it gives lot of errors i think some libraries which ae specific to HP UNIX are missing can some one tell me where i can get the libraried related to this topic.

thanks and regars
Vikram
25 REPLIES 25
Dennis Handly
Acclaimed Contributor

Re: compiling problem in Perl module in HP UNIX 11i

>This is the thread which was closed explicitly by HP, I didn't understood why it was closed.

Which? This is still there:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1180226

>but if i try to compile the code it gives lot of errors. i think some libraries which are specific to HP UNIX are missing

What are your errors?
CA1490051
Frequent Advisor

Re: compiling problem in Perl module in HP UNIX 11i


Hi Dennis,

Below are some errors i am getting if i try to compile the insert program given in the perldoc perlembed man pages.



/opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE/perlvars.h", line 69: error #2757:
variable "EXT" is not a type name
PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler) /* Pointer to C-level sighandler */
^

"/opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE/perlvars.h", line 69: error #2065:
expected a ";"
PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler) /* Pointer to C-level sighandler */
^

"/opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE/perlvars.h", line 73: error #2077-D:
this declaration has no storage class or type specifier
PERLVARI(Guse_safe_putenv, int, 1)
^

"/opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE/perlvars.h", line 73: error #2065:
expected a ";"
PERLVARI(Guse_safe_putenv, int, 1)
^

"/opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE/reentr.inc", line 234: error #2757:
variable "PerlInterpreter" is not a type name
dTHX;
^

"/opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE/reentr.inc", line 234: error #2029:
expected an expression
dTHX;
^

"/opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/CORE/reentr.inc", line 234: error #2018:
expected a ")"
dTHX;


I dont know ehat all libraries i should include or i shoud reinstall the PERL ????

Please let me know your feedback
thnaks and regards
Vikram
Dennis Handly
Acclaimed Contributor

Re: compiling problem in Perl module in HP UNIX 11i

>Below are some errors i am getting if i try to compile the insert program given in the perldoc perlembed man pages.
".../perlvars.h", line 69: error #2757: variable "EXT" is not a type name
PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler)

These look like macro errors.
You need to compile with -E -.i to see if you see anything obvious.

>I don't know what all libraries i should include or i should reinstall the PERL????

You haven't gotten to the link stage so it has nothing to do with libs yet.
CA1490051
Frequent Advisor

Re: compiling problem in Perl module in HP UNIX 11i

Hi Dennis,

I compiled the code with -E option, i am using following Makefile to compile the code

I didnt got any error or warning messages what exactily do you man by something is obvious.

Please let me know your views.


INC = -I/opt/perl/lib/5.8.8/PA-RISC1.1-thread-multi/CORE/ \
-I/opt/perl/lib/5.8.8 \
-I/opt/perl/lib/5.8.8/PA-RISC1.1-thread-multi \
-I/usr/local/xibin
LIB = -L/usr/lib/hpux32/ \
-L/opt/perl/lib/5.8.8/PA-RISC1.1-thread-multi/CORE/ \
-L/opt/perl/lib/5.8.8

#LFLAGS = -E

src=HelloWorld.c

all : $(SRC)
cc $(LFLAGS) $(INC) -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LIB) $(SRC) -lperl -lm
#cc $(INC) $(LFLAGS) -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LIB) -o Hello $(SRC) -lperl -lm

My perl Installation resides in /opt/perl/


thanks and regards
Vikram

Dennis Handly
Acclaimed Contributor

Re: compiling problem in Perl module in HP UNIX 11i

>I compiled the code with -E option, i am using following Makefile to compile the code

I don't see any compiles with "-E -.i"?

This will create a HelloWorld.i for each HelloWorld.c.

>I didn't got any error or warning messages what exactly do you mean by something is obvious.

Compiling with -E bypasses the compile stage but lets you look at the macro expansion.
You would then have to look at the corresponding line to "perlvars.h", line 69".

You could try bypassing this step by not adding "-E -.i" and instead use "+legacy_cpp" and then the error messages may point right at the macro expansion.
CA1490051
Frequent Advisor

Re: compiling problem in Perl module in HP UNIX 11i

Hi Dennis,

I am referring to the man pages and deifining all the flags needed as indicated in the perl -V command output.

I tried with +legacy_cpp but cc is not recognising this flag.

I think i am missing some path settings and switches that should be defined .

Because in the error i am also getting this kind of errors
cc: "/opt/perl/lib/5.8.8/PA-RISC1.1-thread-multi/CORE/perl.h", line 3464: error 1000: Unexpected symbol: "char".

I am not understanding how to go with these kinf of errors .

Please let me know your inputs this .

thanks and regards
Vikram

H.Merijn Brand (procura
Honored Contributor

Re: compiling problem in Perl module in HP UNIX 11i

What is your cc pointing at? Do you use the ANSI C-compiler or the bundled braindead compiler?

In the latter case, you could as well stop immediately, as perl needs a full-ANSI C compiler.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
CA1490051
Frequent Advisor

Re: compiling problem in Perl module in HP UNIX 11i

Hi Merijn,

If I give man cc
It displays

Requires Optional ansi C compiler

Do you mean the compiler i am using is not ANSI C from this.

If yes after installing the ANSI C compiler i should reinstall PERL as it should be compiled with ANSI C Compiler?


thanks and regards
Vikram
Dennis Handly
Acclaimed Contributor

Re: compiling problem in Perl module in HP UNIX 11i

>I tried with +legacy_cpp but cc is not recognising this flag.

I can't see how it wouldn't. From your error message format above, it seems you are using aCC6 on IPF. What version?( Or cadvise?)

>I think i am missing some path settings and switches that should be defined.

Possible.

>Because in the error i am also getting this kind of errors
cc: ".../perl.h", line 3464: error 1000: Unexpected symbol: "char".

This error style is the PA C compiler, no longer IPF. What's changing??

>I am not understanding how to go with these kind of errors.

Compile with -E and redirect stdout to a file foo.i. Then use vi to look at that file around line 3464 for perl.h. You'll have to look at the #number entries for perl.h and interpolate where 3464 is.

>H.Merijn: Do you use the ANSI C-compiler

It seems like it.

>If I give man cc
Requires Optional ansi C compiler

It looks like you have it.