comparison pyvamp-main.cpp @ 19:a54850da8229

* Windows build (with mingw32 atm)
author cannam
date Mon, 13 Jul 2009 12:23:51 +0000
parents e9cf443b18f5
children 812fbde7eca5
comparison
equal deleted inserted replaced
18:e9cf443b18f5 19:a54850da8229
104 static std::vector<PyPluginAdapter *> adapters; 104 static std::vector<PyPluginAdapter *> adapters;
105 static bool haveScannedPlugins = false; 105 static bool haveScannedPlugins = false;
106 106
107 static bool tryPreload(string name) 107 static bool tryPreload(string name)
108 { 108 {
109 // cerr << "Trying to load Python interpreter library \"" << name << "\"..."; 109 cerr << "Trying to load Python interpreter library \"" << name << "\"...";
110 #ifdef _WIN32
111 void *lib = LoadLibrary(name.c_str());
112 if (!lib) {
113 cerr << " failed" << endl;
114 return false;
115 }
116 #else
110 void *lib = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL); 117 void *lib = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL);
111 if (!lib) { 118 if (!lib) {
112 // char *err = dlerror(); 119 cerr << " failed" << endl;
113 // if (err && err[0]) {
114 // cerr << " failed (" << err << ")" << endl;
115 // } else {
116 // cerr << " failed" << endl;
117 // }
118 return false; 120 return false;
119 } 121 }
120 // cerr << " succeeded" << endl; 122 #endif
123 cerr << " succeeded" << endl;
121 return true; 124 return true;
122 } 125 }
123 126
124 static bool preloadPython() 127 static bool preloadPython()
125 { 128 {