I havent been able to use the Simple perl API . I am having the linking issues with runtime libraries .
************SAMPLE code from the SPI programmer guide*******
use VMWare::Vix::Simple;
use VMware::Vix::API::Constants;
my $err = VIX_OK;
my $hostHandle = VIX_INVALID_HANDLE;
($err, $hostHandle) = HostConnect(VIX_API_VERSION,
VIX_SERVICEPROVIDER_VMWARE_WORKSTATION,
undef, # hostName
0, # hostPort
undef, # userName
undef, # password
0, # options
VIX_INVALID_HANDLE); # propertyListHandle
die "HostConnect() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;
\# ...Do everything in your program...
HostDisconnect($hostHandle);
*************
i get the followign error when running the above script.
****************
Runtime Error!
Program: C:\Perl\bin\perl.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
*****************
and the following stack trace
*****************
Can't load 'C:/Perl/site/lib/auto/VMware/VixBinding/VixBinding.dll' for module VMware::VixBinding: load_file:A
dynamic link library (DLL) initialization routine failed at C:/Perl/lib/DynaLoader.pm line 230.
at C:/Perl/site/lib/VMware/Vix/API/API.pm line 13
Compilation failed in require at C:/Perl/site/lib/VMware/Vix/API/API.pm line 13.
BEGIN failed--compilation aborted at C:/Perl/site/lib/VMware/Vix/API/API.pm line 13.
Compilation failed in require at C:/Perl/site/lib/VMWare/Vix/Simple.pm line 23.
BEGIN failed--compilation aborted at C:/Perl/site/lib/VMWare/Vix/Simple.pm line 23.
Compilation failed in require at vimtest.pl line 1.
BEGIN failed--compilation aborted at vimtest.pl line 1.
*****************how i installed VIX PERL ******************
I already have the c VIX API working . I wanted to switch to perl for various reasons .
i ran the following batch file at the command prompt.
C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat
then switched to vix-perl directory on the command prompt ( C:\Program Files\VMware\VMware VIX\vix-perl )
>perl makefile.pl
Writing Makefile for VMware::VixBinding
>nmake
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -
DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD
-Zi -DNDEBUG -O1 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\Perl\lib\CORE" -Dbool=char -DHAS_BOOL
VixBinding.c
VixBinding.c
VixBinding.xs(100) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s
instead. To disable deprecation, use CRTSECURE_NO_WARNINGS. See online help for details.
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(74) : see declaration of 'strcpy'
Running Mkbootstrap for VMware::VixBinding ()
C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 VixBinding.bs
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp vix.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp libeay32.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp ssleay32.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp libxml2.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp zlib1.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp iconv.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp libxml2d.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp iconvd.dll blib\bin
link -out:blib\arch\auto\VMware\VixBinding\VixBinding.dll -dll -nologo -nodefaultlib -debug -opt:ref,icf -
libpath:"C:\Perl\lib\CORE" -machine:x86 VixBinding.obj vix.lib C:\Perl\lib\CORE\perl58.lib oldnames.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib -
def:VixBinding.def
Creating library blib\arch\auto\VMware\VixBinding\VixBinding.lib and object
blib\arch\auto\VMware\VixBinding\VixBinding.exp
C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 755 blib\arch\auto\VMware\VixBinding\VixBinding.dll
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp VixBinding.bs blib\arch\auto\VMware\VixBinding\VixBinding.bs
C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 blib\arch\auto\VMware\VixBinding\VixBinding.bs
>nmake install
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp vix.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp libeay32.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp ssleay32.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp libxml2.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp zlib1.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp iconv.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp libxml2d.dll blib\bin
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp iconvd.dll blib\bin
link -out:blib\arch\auto\VMware\VixBinding\VixBinding.dll -dll -nologo -nodefaultlib -debug -opt:ref,icf -
libpath:"C:\Perl\lib\CORE" -machine:x86 VixBinding.obj vix.lib C:\Perl\lib\CORE\perl58.lib oldnames.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib -
def:VixBinding.def
Creating library blib\arch\auto\VMware\VixBinding\VixBinding.lib and object
blib\arch\auto\VMware\VixBinding\VixBinding.exp
C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 755 blib\arch\auto\VMware\VixBinding\VixBinding.dll
Installing C:\Perl\site\lib\auto\VMware\VixBinding\VixBinding.dll
Installing C:\Perl\site\lib\auto\VMware\VixBinding\VixBinding.exp
Installing C:\Perl\site\lib\auto\VMware\VixBinding\VixBinding.lib
Installing C:\Perl\site\lib\auto\VMware\VixBinding\VixBinding.pdb
Files found in blib\arch: installing files in blib\lib into architecture dependent library tree
Appending installation info to C:\Perl\lib/perllocal.pod
***************************************
I have windows XP SP2 . VS 2005 pro, perl 5.8.8 , workstation 6 and VIX API 1.1 .