savi has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am very new to PERL and I have been fighting with this issues for past one week now. It is very disappointing that I am not able to solve this issue. Any help is greatly appreciated. I downloaded the LAB::VISA module from http://search.cpan.org/dist/Lab-VISA/li ... lation.pod and unzipped it. I downloaded NI-VISA, and my Makefile.PL looks like this:

(($^O =~ /MSWin32/) ? ('LIBS' => ['"-lC:\\Program Files\\IVI Foundation\\VISA\\WinNT\\lib\ +\msc\\visa32.lib"'], 'INC' => '"-IC:\\Program Files\\IVI Foundation\\VISA\\WinNT\\Include"' +, ) : ('LIBS' => ['-lvisa'], 'INC' => '-I/usr/local/include/', ) ),
But when I make the file I get the below error, what am I doing wrong?

C:\Strawberry\cpan\Lab-VISA-3.02>perl Makefile.PL CC=/usr/bin/gcc Note (probably harmless): No library found for -lvisa Writing Makefile for Lab::VISA Writing MYMETA.yml C:\Strawberry\cpan\Lab-VISA-3.02>make Skip blib/lib/Lab/VISA.pod (unchanged) Skip blib/lib/Lab/VISA/Installation.pod (unchanged) Skip blib/lib/Lab/VISA.pm (unchanged) /usr/bin/gcc -c -I/usr/local/include/ -DPERL_USE_SAFE_PUTENV -U__STRIC +T_ANSI__ -g -fno-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3 -DV +ERSION =\"3.02\" -DXS_VERSION=\"3.02\" "-I/usr/lib/perl5/5.14/i686-cygwin-thr +eads-64i nt/CORE" visa_wrap.c visa_wrap.c:1558:18: fatal error: visa.h: No such file or directory compilation terminated. Makefile:336: recipe for target `visa_wrap.o' failed make: *** [visa_wrap.o] Error 1
My Makefile is as follows:
#This is where the problem occurs. .c$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) + $*.c

Replies are listed 'Best First'.
Re: Unable to install Lab::VISA module
by syphilis (Archbishop) on Dec 04, 2014 at 21:42 UTC
    No library found for -lvisa

    The Visa library has not been found.

    visa.h: No such file or directory

    The Visa header was not found.

    These files might not have been found because they've been placed in a directory (Program Files) whose name contains a space.
    You could try relocating Visa such that there are no spaces in the path ... or you could try updating ExtUtils::MakeMaker to the latest version from CPAN, as that version handles those spaces correctly.

    I think there's a good chance that's all you need to attend to - but get back to us if that doesn't solve your problems.

    UPDATE Also note that if you're running under Cygwin then $^O does not match /MSWin32/.
    And does Cygwin understand native Windows style paths (C:\whatever) or do you need to specify /cygdrive/c/whatever ??

    Cheers,
    Rob
      The main directory is C:\Strawberry, so the install is probably not Cygwin.
        Yeah I have installed Strawberry perl and trying to install the Lab::VISA module from Windows command prompt.
      Thanks Rob, let me try this option and I shall let you know. I am running from command prompt. I do have two versions of cygwin installed as well. But I am not using cygwin to run these perl scripts.
        Thanks for your time Rob. I did update the ExtUtils::MakeMaker, and I still have this problem. I do notice one strange thing though, according to this link http://search.cpan.org/dist/Lab-VISA/lib/Lab/VISA/Installation.pod they ask me to correct the EXTRALIBS and LDLOADLIBS by adding the "C:\path\to\visa32.lib" to each of of these lines. But I dont see EXTRALIBS and LDLOADLIBS in my Makefile. What am I doing wrong?
        C:\Strawberry\cpan\Lab-VISA-3.02>perl Makefile.PL Warning (mostly harmless): No library found for -lvisa Generating a Unix-style Makefile Writing Makefile for Lab::VISA Writing MYMETA.yml and MYMETA.json C:\Strawberry\cpan\Lab-VISA-3.02>make Skip blib/lib/Lab/VISA.pod (unchanged) Skip blib/lib/Lab/VISA/Installation.pod (unchanged) Skip blib/lib/Lab/VISA.pm (unchanged) Running Mkbootstrap for Lab::VISA () chmod 644 "VISA.bs" gcc-4 -c -I/usr/local/include/ -DPERL_USE_SAFE_PUTENV -U__STRICT_ANS +I__ -g -fn o-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3 -DVERS +ION=\"3.02 \" -DXS_VERSION=\"3.02\" "-I/usr/lib/perl5/5.14/i686-cygwin-threads- +64int/CORE " visa_wrap.c visa_wrap.c:1558:18: fatal error: visa.h: No such file or directory compilation terminated. Makefile:342: recipe for target `visa_wrap.o' failed make: *** [visa_wrap.o] Error 1
Re: Unable to install Lab::VISA module
by dasgar (Priest) on Dec 04, 2014 at 23:54 UTC

    The group that maintains this module has a web page about using this module at http://www.labmeasurement.de/.

    From that site, there's information about keeping their source code on Github. (https://github.com/lab-measurement/lab-measurement --- and the last commit was within the past 24 hours) If you're having installation issues, you can try submitting an issue on Github.

    Also, their web site has a link to a users mailing list (https://www-mailman.uni-regensburg.de/mailman/listinfo/lab-measurement-users). You can also try joining that mailing list and try going that route to get help with installation problems.

    I'm not saying that you won't be able to get help in this forum, but I would think that the guys who are actively maintaining the module may be the best route to go for help - especially if you've discovered a bug that they need to work on fixing.

      Thanks for the reply dasgar! I think it is something got to do with my laptop settings I guess, the same module works fine on my collegues laptop.

        As for settings, it looks like syphilis is probably on the right track in identifying that it looks like you have two Perl installations (Strawberry Perl and Perl in the Cygwin environment) and that may be the first level of problems for you and possibly the only issue that you have.

Re: Unable to install Lab::VISA module
by toolic (Bishop) on Dec 04, 2014 at 21:25 UTC
      I did follow these steps, but that does not help. See the error message
      C:\Strawberry\cpan\Lab-VISA-3.02>make Skip blib/lib/Lab/VISA.pod (unchanged) Skip blib/lib/Lab/VISA/Installation.pod (unchanged) Skip blib/lib/Lab/VISA.pm (unchanged) gcc-4 -c -I/usr/local/include/ -DPERL_USE_SAFE_PUTENV -U__STRICT_ANS +I__ -g -fn o-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3 -DVERS +ION=\"3.02 \" -DXS_VERSION=\"3.02\" "-I/usr/lib/perl5/5.14/i686-cygwin-threads- +64int/CORE " visa_wrap.c visa_wrap.c:1558:18: fatal error: visa.h: No such file or directory compilation terminated. Makefile:336: recipe for target `visa_wrap.o' failed make: *** [visa_wrap.o] Error 1
      I am unable to copy the entire Makefile, but the error is at this line:
      .c$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) + $*.c