CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: debug exe in IDE vs outside IDE

  1. #1
    Join Date
    Aug 2002
    Location
    Colorado
    Posts
    59

    debug exe in IDE vs outside IDE

    C++ console application in Visual Studio 2005.

    Debug build runs fine from inside the IDE. When debug build is run outside the IDE it returns error codes and terminates.

    Same exe, right? Why would this be?
    majoob

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,750

    Re: debug exe in IDE vs outside IDE

    Perhaps, your exe needs something that not exists outside the IDE?
    Victor Nijegorodov

  3. #3
    Join Date
    Feb 2002
    Posts
    4,640

    Re: debug exe in IDE vs outside IDE

    Is you PATH set correctly? IIRC, you can set/add to the PATH from within the IDE.

    Viggy

  4. #4
    Join Date
    Aug 2002
    Location
    Colorado
    Posts
    59

    Re: debug exe in IDE vs outside IDE

    Let me clarify a little:
    This program exercises and tests database operations, checking return values for accuracy. It's not accessing a separate database file... the test program does everything in memory.

    The debug version run from within the IDE successfully completes all tests and finishes without errors.

    The debug version run stand-alone (outside the IDE) gets through about 2/3 of the database tests then fails and terminates.

    I can understand differences between debug and release, but this is debug vs debug, again same exe, same binary, same instruction set.
    majoob

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,750

    Re: debug exe in IDE vs outside IDE

    Quote Originally Posted by majoob
    Let me clarify a little:
    This program exercises and tests database operations, checking return values for accuracy. It's not accessing a separate database file...
    Well, then where does the database exist?
    Victor Nijegorodov

  6. #6
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Re: debug exe in IDE vs outside IDE

    One difference between running the exe from within the IDE and without is, that IDE sets the current directory of the exe to the project folder (where you have all those cpp & h files) and running the exe normally (e.g. double-click) the current directory is the current directory . This can have some unsuspected effects if you are using relative paths like

    CString StrFilePath = _T(".\\my_file.xml");

    Hope this helps,
    Regards,
    Usman.

  7. #7
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,595

    Re: debug exe in IDE vs outside IDE

    I'd tend to suspect a memory allocation problem since memory allocation is probably subtlely different when running in the debugger. Can't be more specific though, I'm afraid.
    "A problem well stated is a problem half solved. - Charles F. Kettering

  8. #8
    Join Date
    Apr 1999
    Posts
    27,449

    Re: debug exe in IDE vs outside IDE

    Quote Originally Posted by majoob
    The debug version run from within the IDE successfully completes all tests and finishes without errors.

    The debug version run stand-alone (outside the IDE) gets through about 2/3 of the database tests then fails and terminates.
    Your application has a bug, plain and simple.

    "My app works on one machine, but not another"
    "My app works when I uninstall <whatever>, but not otherwise"
    "My app worked yesterday, but today it crashes".

    etc...etc...

    Your situation is just a variation on the same theme. You run it in one environment, works, another environment doesn't work.

    This sounds like a memory overwrite in your application, or some other issue that isn't obvious (threading maybe?). But the bottom line is that your situation is not unique, as it happens to every programmer at some point.

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)