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:
dumpbin /EXPORTS perl510.dll > perl510.exports
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:
lib /def:perl510.def /out:perl510.lib
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:
perl -le "open RD, 'perl510.exports'; while (<RD>) { print (split /\s+ +/, $_)[4] }" >perl510.def
And then I manually added the EXPORTS line at the top of the file.
When I ran the lib command, I got:
C:\expt>lib /def:perl510.def /out:perl510.lib Microsoft (R) Library Manager Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. LIB : warning LNK4068: /MACHINE not specified; defaulting to X86 Creating library perl510.lib and object perl510.exp
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:
gendef perl510.dll
Then, as before, run:
lib /def:perl510.def /out:perl510.lib
Cheers,
Rob

In reply to Re: perl510.lib needed to compile C++ code by syphilis
in thread perl510.lib needed to compile C++ code by rakesh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.