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

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

Replies are listed 'Best First'.
Re^4: linking C/C++ lib with Perl h2xs XSUBs.
by derrick0627us (Novice) on Mar 06, 2012 at 23:14 UTC
    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.