Menu

Different behaviour of Dev-C++, the same code

Tornila
2011-04-21
2012-09-26
  • Tornila

    Tornila - 2011-04-21

    Hello,

    I'm developing an application using the SDL libraries. Until now I have a code
    that is working, I compiled and run it from Dev-C++ using "Compile and run"
    button and everything is OK. But, when I run the application making double-
    click on the icon, the program crashes saying that it couldn't find an image.

    First I thought the working directory was different depending on where you run
    your app so I wrote in the code 'system("dir")' to show the files in the
    current directory. Then I executed again the app from Dev-C++ and making
    double-click on it, system() returned the correct directory in both cases but
    still, when I do double-click it cant open the images I use. Isn't that
    weird?? If somebody has an idea why this is happening I would apreciated.

    Thanks in advance!!

     
  • Tornila

    Tornila - 2011-04-23

    I will answer myself.

    When you run an application on Windows, if some dll is missing pops-up a a
    window saying some xxx.dll is missing, so if you copy the file on the same
    folder then the application runs ok when you run it making double-click.

    The problem was that there were some .dll files that the program need to load
    an image but the application doesn't tell you. So, copying the necessary .dll
    files from the dev-cpp/bin folder to my project folder solved the problem.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.