We are trying to use SWIG 1.3.36 with perl  5.8.8 and the Visual Studio C++ 2005 compiler. The header file used in our mdMatchup.i file is shown below. In our mdMatchup.i , we are using the module mdMatchupTest. We ran swig -c++ -perl mdMatchup.i and obtained mdMatchup.pm and mdMatchup_wrap.cxx.
       We read that SWIG Perl can handle C++ enumerations. But, when we use the enumerations in our test.pl program:
 
#!perl.exe -w
use strict;
use mdMatchupTest;

my $readwrite;
$readwrite = mdMatchupTestc::new_mdMUReadWrite();
 
mdMatchupTestc::mdMUReadWrite_SetLicenseString($readwrite,"LL58JH2Y");
mdMatchupTestc::mdMUReadWrite_SetPathToMatchUpFiles($readwrite,"C:\\MatchupAPI\\Distribution");
if (mdMatchupTestc::mdMUReadWrite_InitializeDataFiles($readwrite) != mdMatchupc::mdMUReadWrite_NoError ){
 print( "Failed to Initialize mdMatchupTestc::mdMUReadWrite ",
  mdMatchupTestc::mdMUReadWrite_GetInitializeErrorString($readwrite). "\n");


we get the Perl interprepter message : Bareword "mdMatchupc::mdMUReadWrite_NoError" not allowed while "strict subs" in use at test.pl line 31. Is there a correct way to use packages with C++ enumerations in our perl program? Thank you.
 
--------------------------------------mdMatchup.h------------------------------------
#if !defined(MDMATCHUP_H)
#define MDMATCHUP_H
#if !defined(MDAPI)
#if defined(_WIN32) || defined(_WIN64)
#define MDAPI __declspec(dllimport)
#else
#define MDAPI
#define __stdcall
#endif
#endif
/*
* C++ version of interface
*/

class MDAPI mdMUReadWrite
{
protected:
struct mdMUReadWrite_ *I;
private: /* disable implicit constructor and assignment */
mdMUReadWrite(mdMUReadWrite &X);
mdMUReadWrite&
operator=(mdMUReadWrite &X);
public:
enum ProgramStatus {
NoError=0,
ConfigFile=1,
LicenseExpired=2,
DatabaseExpired=3
};

mdMUReadWrite();
~mdMUReadWrite();

/* Setup methods */
void SetPathToMatchUpFiles(const char *Path);
void SetMatchcodeName(const char *MatchcodeName);
void SetMatchcodeObject(mdMUMatchcode *Matchcode);
void SetKeyFile(const char *KeyFile);
enum ProgramStatus InitializeDataFiles();
const char *GetInitializeErrorString();
void Initialize(void);
int SetLicenseString(const char*);
}




See how Windows connects the people, information, and fun that are part of your life. See Now