can only run from terminal

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
byllgrim
Posts: 9
Joined: Mon May 28, 2012 12:13 pm

can only run from terminal

Post by byllgrim »

if i doubleclick the executable and either choose execute, or execute in terminal, the irrlicht window appears and immediately closes, but if i navigate to the folder in terminal and ./execute_my_program it works. the same goes for the examples.
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: can only run from terminal

Post by Nyx Erebos »

There are not much information in your post. Does it do the same thing with other programs which don't use Irrlicht ? Just throwing a random thought : try to launch it in root mode from another terminal.

Edit : sorry I meant from another folder.
CuteAlien
Admin
Posts: 9693
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: can only run from terminal

Post by CuteAlien »

Do you load something (textures, models....)? In that case it could be trouble with your working directory. You can test that with the following program which will write out the working folder and the path you get passed as parameter to your application by the operating system to a file called binpath.txt.

Code: Select all

 
#include <cstdio>
#include <unistd.h>
 
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
#endif // MAXPATHLEN
 
int main (int argc, char *argv[])
{
        FILE * f = fopen("binpath.txt", "a");
        char cwd[MAXPATHLEN];
    getcwd(cwd, MAXPATHLEN);    
        
        printf("cwd: %s\n", cwd);
        fprintf(f, "cwd: %s\n", cwd);
        
        for (int i = 0; i < argc; i++)
        {
                printf("argv[%d]: %s\n", i, argv[i]);
                fprintf(f, "argv[%d]: %s\n", i, argv[i]);
        }
                
        fclose(f);
 
        return 0;
}
 
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply