in reply to Unable to install Lab::VISA module

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

Replies are listed 'Best First'.
Re^2: Unable to install Lab::VISA module
by Laurent_R (Canon) on Dec 04, 2014 at 22:25 UTC
    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.
        Yeah I have installed Strawberry perl and trying to install the Lab::VISA module from Windows command prompt

        But there's a "gcc-4" (in your second post) and, on Windows at least, Cygwin is the only system that has a compiler named "gcc-4" (AFAIK).
        Also, when you ran 'make', there were no complaints about incorrect syntax in the Makefile - which suggests to me that the Makefile was written for the 'make' utility - which means you ran a Cygwin perl as that's the only perl on Windows that writes Makefiles for 'make' by default. (Other Windows perls write Makefiles for either 'nmake' or 'dmake' by default.)
        It's most unusual on Windows to have a 'make' utility at your disposal unless Cygwin is in your path. If your perl is Strawbeery Perl you need to run 'dmake'.

        Best thing would be to run perl -V and post the output so that we can see exactly which perl is being invoked.
        And also provide the output for /usr/bin/gcc -v (and any other CC you might have specified).

        Lastly, note that if you are using a Cygwin perl, then that Windows library for Visa will be of no use - you'll have to use a Visa library built for Cygwin. There may be one you can install using setup.exe.

        However, I now gather that your intention is to use Strawberry Perl. In order to do that, make sure you're running in a native Windows (cmd.exe) shell, not a Cygwin shell.

        Cheers,
        Rob
Re^2: Unable to install Lab::VISA module
by savi (Novice) on Dec 04, 2014 at 22:24 UTC
    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
        I did copy the visa32.lib and visa.h to C:\Strawberry\cpan\Lab-VISA-3.02\include and C:\Strawberry\cpan\Lab-VISA-3.02\msc and changed my Makefile.PL as follows, but that does not work either. What else I need to correct?
        #!/usr/bin/perl use strict; use ExtUtils::MakeMaker; # If you have Swig installed, un-comment the next line # to re-create the wrapper code. # If you do so, also un-comment the 'clean' section below # to delete the swig-generated files when doing 'make clean'. # TODO: should just check if swig is in the path # system("swig -perl5 -module Lab::VISA visa.i"); WriteMakefile( # 'clean' => { # FILES => 'VISA.pm visa_wrap.c' # }, # Important: you have to adjust the 'LIBS' and 'INC' paths according t +o your local setup! # The correct values may depend on your exact version of LabView, VISA +, GPIB drivers, # the phase of the moon and the local neutrino density... # First two lines are for Windows, second two lines are for Linux. # TODO: find out how to figure these out automatically. (($^O =~ /MSWin32/) ? ('LIBS' => ['"-lC:\\Program Files\\IVI Foundation\\VIS +A\\WinNT\\lib\\msc\\visa32.lib"'], 'INC' => '"-IC:\\Program Files\\IVI Foundation\\VISA +\\WinNT\\Include"', ) : ('LIBS' => ['-lvisa'], 'INC' => '-I/usr/local/include/', ) ), 'NAME' => 'Lab::VISA', 'VERSION_FROM' => 'VISA.pm', 'OBJECT' => q/$(O_FILES)/, 'META_MERGE' => { resources => { homepage => 'https://www.labmeasurement.de/', bugtracker => 'https://www.labmeasurement.de/bugs/', MailingList => 'lab-measurement-users@mailman.uni-reg +ensburg.de', }, }, 'ABSTRACT_FROM' => 'VISA.pod', 'AUTHOR' => ['Daniel Schröer <schroeer@cpan.org>', 'An +dreas K. Hüttel <mail@akhuettel.de>'], );