[Kde-perl] Embedding perl in Qt

Ashley Winters jahqueel at yahoo.com
Wed Sep 6 04:52:21 CEST 2006


-- Matthew Pressly <mpressly at claborn.net> wrote:

> As an alternative to using qt-perl, is it possible to embed a
> perl interpreter (like what's described in the perlembed manpage
> in the perl documentation) in a C++ QT3 or QT4 application so 
> that perl subroutines and code can be called from the C++ code?

Yes, it can work.

> I know this can be done from a non-QT C application, but have
> not been able to get it working from C++ with QT3.
> 
> Here is what I have tried so far:
> 
>   perl -MExtUtils::Embed -e ccopts -e ldopts

That would be okay if you were compiling the program in one stage, but
your Makefile is using -c to compile one source file at a time.

For each source file, use -e ccopts  (without the ldopts)

For the final run of g++ to make the executable, which won't have any
.cpp files listed in the command-line, use -e ldopts.

Ashley Winters


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Kde-perl mailing list