473,395 Members | 1,649 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Linking problem when trying to use perlembed

Hi,
I am try to embed perl in my c++ code,I wrote following sample code

----------------------------------------------------------------------------------------------
#include <EXTERN.h> /* from the Perl distribution */
#include <perl.h> /* from the Perl distribution */
static PerlInterpreter *my_perl; /*** The Perl interpreter ***/
int main(int argc, char **argv, char **env)
{
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
perl_construct(my_perl);
//PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
}
-------------------------------------------------------------------------------------------------
compilation went fine,when I try to link this with libperl.so I get following error

perlint.o: In function `main':
perlint.c:(.text+0x42): undefined reference to `PL_exit_flags'
perlint.c:(.text+0x49): undefined reference to `PL_exit_flags'
collect2: ld returned 1 exit status

----------------------------------------------------------------------------------------------------
Note: I am compiling this code using cross-compiler my host is solaris 2.10 and
target is fedora 6( i686-linux).

Also I copied libperl.so from fedora machine to solaris and trying to link with same library.

Could anyone please provide me some input.

Thanks In Advance
jmishra
Dec 9 '07 #1
1 1609
numberwhun
3,509 Expert Mod 2GB
Hi,
I am try to embed perl in my c++ code,I wrote following sample code

----------------------------------------------------------------------------------------------
#include <EXTERN.h> /* from the Perl distribution */
#include <perl.h> /* from the Perl distribution */
static PerlInterpreter *my_perl; /*** The Perl interpreter ***/
int main(int argc, char **argv, char **env)
{
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
perl_construct(my_perl);
//PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
}
-------------------------------------------------------------------------------------------------
compilation went fine,when I try to link this with libperl.so I get following error

perlint.o: In function `main':
perlint.c:(.text+0x42): undefined reference to `PL_exit_flags'
perlint.c:(.text+0x49): undefined reference to `PL_exit_flags'
collect2: ld returned 1 exit status

----------------------------------------------------------------------------------------------------
Note: I am compiling this code using cross-compiler my host is solaris 2.10 and
target is fedora 6( i686-linux).

Also I copied libperl.so from fedora machine to solaris and trying to link with same library.

Could anyone please provide me some input.

Thanks In Advance
jmishra
I hate to say this, but since you are trying to use embeded perl in C++, I believe that this question should actually be asked in the C++ forum. The errors you are receiving are not Perl errors but C++ errors.

I am moving this over to that forum. If it is deemed to be other than C++, I am sure one of the moderators will move it back over here.

Regards,

Jeff
Dec 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jeff Hagelberg | last post by:
I'm trying to create a python module which can be used by a python interpreter embedded inside a fortran program I have. To do this, I first created python wrappers for all the functions in my...
2
by: Ian | last post by:
I've downloaded 3rd party libraries and I'm trying to link them in with my code but when I use -l<library name> it gives me the error "ld: cannot find -l<lib name>". When I link the libraries...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
0
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when...
2
by: Manuel T | last post by:
Hello everybody, I'm trying to port a project from Windows+Cygwin to Linux(i'm working on a Debian-like: Kubuntu), but I'm facing a lot of linking problems. This project needs libraries xerces...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
3
by: ARC | last post by:
I'm having trouble here with Access 2007 and connecting to a different database. The code below works great IF the previous back-end database connection is still present and you are trying to...
7
by: Salad | last post by:
I am converting an application from A97 to A2003. I have 2 tables created by another application as a Foxpro.dbf. The table has no index. The connect string in A97 is FoxPro...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.