"be consistent" | |
PerlMonks |
Re: perl510.lib needed to compile C++ codeby syphilis (Archbishop) |
on Mar 15, 2022 at 12:32 UTC ( [id://11142114]=note: print w/replies, xml ) | Need Help?? |
During compilation it is complaining perl510.lib is missing The problem is that, with mingw-built perls, the needed import lib (which is to be found in perl/lib/CORE) is named libperl510.a, not perl510.lib. You need to use your VS 2008 to create "libperl510.a" directly from the "perl510.dll" that you have located. The following is modified from https://stackoverflow.com/questions/9360280/how-to-make-a-lib-file-when-have-a-dll-file-and-a-header-file. (Refer to that link first if something doesn't work. Its title is a little misleading as no header file is needed.) Firstly, run: Paste the names of the functions from perl510.exports into a new file named perl510.def. Add a line with the word EXPORTS at the top of this file. Then, assuming that your VC environment has been properly set up (by running vcvars32.bat or whatever it is), you run: You should get two files generated: perl510.lib and perl510.exp . You then need to place perl510.lib somewhere where it's found - probably in perl/lib/CORE (ie in the same place as libperl510.a). I know this procedure can work, as I've done it before. But it's something I haven't done for a long time, and I'm a bit hazy on the details. See how you go, and report back if you get stuck. UPDATE 1: I gave it a go using VC++ 7.0 and Strawberry Perl-5.12.2. Seemed to go ok. With perl510.exports, I first removed the short section of stuff at the beginning that comes before the listing of the functions begins. And I also removed the short "Summary" section at the end. To generate perl510.def I then ran: And then I manually added the EXPORTS line at the top of the file. When I ran the lib command, I got: That all seems OK. UPDATE 2: A simpler way to create the def file is to use gendef, which ships with later versions of Strawberry Perl. Just create perl510.def by running: Then, as before, run: Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|