Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

perlcc && perlTk

by byoungvt (Initiate)
on Apr 05, 2002 at 09:53 UTC ( [id://156865]=perlquestion: print w/replies, xml ) Need Help??

byoungvt has asked for the wisdom of the Perl Monks concerning the following question:

How do I compile a perlTk program into a binary with perlcc
so that the Tk libraries are compiled into my executable.
I compile with this:
gcc -I/usr/local/include -O
-I/usr/local/lib/perl5/5.00503/sun4
-solaris/CORE /usr/local/lib/perl5/5.00503/sun4
-solaris/auto/Fcntl/Fcntl.so -o hw5 stricttrans2.pl.c
-L/usr/local/lib -L/usr/local/lib/perl5/5.00503/sun4-solaris/CORE
-lperl -lsocket -lnsl -ldl -lm -lc -lcrypt

And want to avoid:


mcs03:mango(6)% ./hw5 -g Can't locate Tk.pm in @INC

(@INC contains: /home/mango/brad /home/mango/sun4-solaris

/usr/local/lib/perl5/5.00503/sun4-solaris

/usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
/usr/local/lib/perl5/site_perl/5.005 .) at stricttrans2.pl line 242.
Is this possible??? I want to run the binary on a machine w/o PerlTk...

Replies are listed 'Best First'.
Re: perlcc && perlTk
by dhable (Monk) on Apr 05, 2002 at 13:28 UTC
    I never used perlcc, but have compiled my Tk applications using Perl2Exe from IndigoStar and recently with the PerlDev Kit from ActiveState. Each one of these applications will run through the script and pull the libraries that are needed to make a standalone executable. If you want speed, I achieved smaller file sizes and faster executables with Perl Dev.
      From my experience with Perl2Exe, it sometimes helps to explicitly 'Use' every module at the top of your main script. In oder to get my Tk apps to compile for Win98, I have to have Tk::blah where 'blah' is every Tk module I use in the application. This may have been improved in a later version of Perl2Exe, but that's what I've had to do in the past. From your error message, you might also try adding some paths to @INC manually with 'use lib'.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://156865]
Approved by rob_au
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found