niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl » modules
Question about creating modules
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Sisyphus
*nix forums Guru


Joined: 04 Mar 2005
Posts: 503

PostPosted: Sun May 28, 2006 4:00 am    Post subject: Re: Question about creating modules Reply with quote

"Mr Cheeky Monkey" <cheeky.monkey23@hotmail.co.uk> wrote in message
news:u8udnV4oIYYcJuXZnZ2dnUVZ8qGdnZ2d@bt.com...
Quote:
Hi,

I'm new to perl and need a little help. I'm using ActiveState Perl under
windows. I've tried creating a module from a C++ source using swig and the
methods outlined in both the perl documentation and the swig
documentation.
I have VC++ installed and making the dll files works successfully.

Which version of VC++ ? With ActiveState perl you really should be using 6.0
(as that's what was used to build perl), though you'll *generally* get good
milage from other (later) VC++ versions. I don't know if/how such a mismatch
would impact upon swig.

Quote:
However
when I try to load the module the perl interpreter seems to loop forever.
The problem seems to occur at the bootstrap stage. Unfortunately I don't
know enough to make a good guess as too what's going on.


In fact, I know stuff-all about swig - so, if you're committed to using
swig, I can't be of much use :-)

However, if you're simply trying to access a dll, there are a number of
other options.
You could use Inline::C (or perhaps in this case Inline::CPP would be more
appropriate).
Or you could write your own extension (module) with XS - which is pretty
much what Inline::C/Inline::CPP do, though they do it using an automated
process. There's a good example of accessing a dll in the Inline::C cookbook
(see the section "Just Desserts" in perldoc Inline::C-Cookbook).
Another alternative is to use Win32::API - for which no compiler is needed,
and which is a fairly popular hack (though I personally prefer to avoid it).

Quote:

I'm using version 5.8.8 of perl and I have stripped out everything in my
C++
code, recompiled and made the library and still it wont load.


Make sure you're using build 817 (or later):
perl -e "print $ActivePerl::VERSION"

Build 816 (which is a 5.8.8 build) is a bad build and should be avoided
altogether.

Cheers,
Rob
Back to top
Mr Cheeky Monkey
*nix forums beginner


Joined: 27 May 2006
Posts: 1

PostPosted: Sat May 27, 2006 8:50 pm    Post subject: Question about creating modules Reply with quote

Hi,

I'm new to perl and need a little help. I'm using ActiveState Perl under
windows. I've tried creating a module from a C++ source using swig and the
methods outlined in both the perl documentation and the swig documentation.
I have VC++ installed and making the dll files works successfully. However
when I try to load the module the perl interpreter seems to loop forever.
The problem seems to occur at the bootstrap stage. Unfortunately I don't
know enough to make a good guess as too what's going on.

I'll try to give a little background as to what I'm trying to achieve. I
have a DLL that I want access from perl. The glue that I need between perl
and the DLL is really just a class definition with a list of pure functions
(some using VARIANT's) that correspond to a virtual table as setup by the
DLL I want to call. The module I'm trying to create only contains 2
functions one to create an instance of the class object and one to destroy
it. SWIG seemed to be what I needed but having produced the necessary file
nd done what I can. I seem to be stuck.

I'm using version 5.8.8 of perl and I have stripped out everything in my C++
code, recompiled and made the library and still it wont load.

Can anybody help?

Leon
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 5:12 am | All times are GMT
navigation Forum index » Programming » Perl » modules
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Newbie question: How to forward a domain to a mailbox? leei Postfix 0 Fri Aug 24, 2007 4:55 pm
No new posts configuration question for httpd Karl Wang Apache 1 Fri Jul 21, 2006 2:10 pm
No new posts nim problem/question Ron AIX 0 Fri Jul 21, 2006 1:57 pm
No new posts question for JAVA developer who r using postgres sql as b... deepak pal PostgreSQL 1 Fri Jul 21, 2006 9:00 am
No new posts Creating relational view for an ODBC result set? antilog@gmail.com Server 0 Fri Jul 21, 2006 5:56 am

Industrial Directory | Credit Cards | Problem Mortgage | Deaf | Fish Tank Help
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1878s ][ Queries: 20 (0.1110s) ][ GZIP on - Debug on ]