codeape Posted September 10, 2014 Share Posted September 10, 2014 Lets make Leadwerks more independent from where it is run. Today you can not start your game from any other place than the dir where the executable is. This does not work: /home/user/mygame/mygame.debug ./mygame/mygame.debug Add the following to the Code::Blocks project in the template files: -Wl,-rpath=\\$$$ORIGIN To make the resource files load from any place add this right before app->Start() in main.cpp of the template files: #ifdef __linux__ FileSystem::SetDir(FileSystem::ExtractDir(argv[0])); #else HMODULE hModule = GetModuleHandle(NULL); if (hModule != NULL) { char exePth[MAX_PATH]; GetModuleFileName(hModule, exePth, MAX_PATH); FileSystem::SetDir(FileSystem::ExtractDir(exePth)); } #endif This is based on this discussion: http://www.leadwerks.com/werkspace/topic/10628-shared-lib-libsteam-apiso-loading-question/ 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.