in reply to Re: linking C/C++ lib with Perl h2xs XSUBs.
in thread linking C/C++ lib with Perl h2xs XSUBs.

I removed the cr command and used lib libmylib.lib mylib.obj in the cmd promot:
Below is the error msg:
C:\Perl\bin\MyTest2\mylib>lib libmylib.lib mylib.obj
Microsoft (R) Library Manager Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
LIB : fatal error LNK1104: cannot open file 'libmylib.lib'
  • Comment on Re^2: linking C/C++ lib with Perl h2xs XSUBs.

Replies are listed 'Best First'.
Re^3: linking C/C++ lib with Perl h2xs XSUBs.
by syphilis (Archbishop) on Feb 18, 2009 at 06:46 UTC
    LIB : fatal error LNK1104: cannot open file 'libmylib.lib'

    Yes - it thinks that libmylib.lib is an input file. Based on the lib /? documentation, the following is probably what's needed: lib /out:libmylib.lib mylib.obj

    Cheers,
    Rob
      Hi! I followed the same procedure but I am still seeing the same error message after running nmake test.
      LINK : fatal error LNK1104: cannot open file 'libmylib.lib'
      This is my Makefile.PL
      use ExtUtils::MakeMaker; $Verbose = 1; WriteMakefile( NAME => 'Mytest2::mylib', SKIP => [qw(all static static_lib dynamic dynamic_lib)], clean => {'FILES' => 'libmylib$(LIBEEXT)'}, MYEXTLIB => 'mylib/libmylib$(LIB_EXT)', ); sub MY::top_targets { ' all :: static pure_all :: static static :: libmylib$(LIB_EXT) libmylib$(LIB_EXT): $(O_FILES) $(AR) libmylib$(LIB_EXT) $(O_FILES) $(RANLIB) libmylib$(LIB_EXT) '; }
      What is wrong here? Thanks.