Skip to content

Commit 56148d9

Browse files
author
Christian Schulte
committed
Set path to find Qt plugins on Windows
git-svn-id: file:///Volumes/GecodeGitMigration/gecode-svn-mirror/gecode/tags/release-4.4.0@14952 e85b7adc-8362-4630-8c63-7469d557c915
1 parent a4e4f35 commit 56148d9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

gecode/gist/gist.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
*
3636
*/
3737

38+
#include <cstdlib>
3839
#include <QtGui>
3940

4041
#include <gecode/gist.hh>
@@ -103,9 +104,25 @@ namespace Gecode { namespace Gist {
103104

104105
int
105106
explore(Space* root, bool bab, const Options& opt) {
107+
108+
#ifdef _MSC_VER
109+
// Set the plugin search path on Windows when in default installation
110+
if (char* gd = getenv("GECODEDIR")) {
111+
unsigned int gdl = static_cast<unsigned int>(strlen(gd) + 32U);
112+
char* gdb = heap.alloc<char>(gdl);
113+
strcpy(gdb, gd);
114+
strcat(gdb, "/bin/");
115+
QCoreApplication::addLibraryPath(gdb);
116+
heap.free(gdb,gdl);
117+
}
118+
#endif
119+
106120
char argv0='\0'; char* argv1=&argv0;
107121
int argc=0;
122+
123+
108124
QApplication app(argc, &argv1);
125+
109126
GistMainWindow mw(root, bab, opt);
110127
return app.exec();
111128
}

0 commit comments

Comments
 (0)