none
My Win32 app won't launch on my home Windows 7 home premium 64 bit system - even under the debugger

    Question

  • I have a Win32 app I wrote at work that works just about everywhere - including WINE (Linux and Mac) and, of course, Windows XP and Windows 7 at work.

    For some reason it won't launch on my home box running Windows 7 home premium 64 bit. Works fine on my 64 bit Win 7 professional box at work - and no end user (there are several thousand) has complained of this problem.

    On the home box, the app I use to launch it (either Windows explorer or the DOS prompt) simply hangs. Task Manager shows 3 124K processes with my app's name - but I can't even kill them from there. I need to log off to get rid of them. The app is about 1MB, so I don't know what these tiny processes are. I'm assuming there's some incompatible library, but the app links everything statically - except the basic Windows GDI stuff. It's straight C code, no run-time DLL's required. The .exe is all I need to run it under WINE, too.

    I tried installing Visual Studio 2013 (which is what I have at work) and building it from source on the home box. It builds, but still won't launch - even under the debugger with a breakpoint at the first line of executable code.  VS simply hangs in the same way that Explorer does when I try to launch the .exe directly.   I've also tried running old versions of the executable built with VS 6.0. Same thing happens everywhere. Also happens with multiple other related apps of mine.

    Any idea what's up? Is home premium crippled in some way? Can't imagine. It runs other 32-bit stuff fine.

    Monday, April 04, 2016 8:00 PM

Answers

All replies

  • It's straight C code, no run-time DLL's required.
    What compiler did you use? Which version? If it is one of the versions of the Visual C++ compiler, did you compile using the /MT switch? If not, then the program has a dependency on the C++ runtime.
    Monday, April 04, 2016 8:21 PM
  • Usage of some anti-virus (Avast?) shows similar symptoms. Would try to disable it temporarily / exclude build directories ... 

    With kind regards

    Monday, April 04, 2016 8:27 PM
  • Microsoft Visual Studio Express 2013 for Windows Desktop
    Version 12.0.40629.00 Update 5

    Visual C++ 2013   06157-004-0441005-02860
    Microsoft Visual C++ 2013

    My project properties shows the command line to be this.  There's an /MTd switch in there.  All those /D "WIN32..." things are just for conditional compliation in a few cross-platform source modules.

    /GS /analyze- /W3 /Gy- /Zc:wchar_t /I".\include" /ZI /Gm /Od /Fd".\Debug\" /fp:precise /D "WIN32_PC" /D "WIN32" /D "_CRT_SECURE_NO_WARNINGS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MTd /Fa".\Debug\" /EHsc /nologo /Fo".\Debug\" /FAcs /Fp".\Debug\wem32.pch"

    The scary part of this isn't that it won't run.  It's that it kind of hangs the system - as much as a single app can.  Even when I try to log out, I have to do a force close - and the Task Manager doesn't seem to be able to do a force stop within my session.  It's almost as though Windows is loading some incompatible library (64-bit?) and trying to run it as 32-bit code - or something.  What I don't know is whether the problem is with the app or my system.  Again, the app works fine on every other box I've run it on.


    Monday, April 04, 2016 8:30 PM
  • Damn, that was it!!!  Excluded the folder with my app from Avast, and it launched right away.  Thanks.

    Any way to tell what Avast was doing?  Shouldn't it simply flag the app and refuse to run it.  Is there a log somewhere of what Avast did.

    Monday, April 04, 2016 8:38 PM
  • There's an /MTd switch in there. 

    Strictly speaking, you should not be using this switch. Use the /MT switch instead. You are incorporating the debug version of the runtime into your executable, and you shouldn't be doing this for production code.

    Glad you solved the problem.

    Monday, April 04, 2016 8:58 PM
  • Those switches were from the debug version.  Anyway it was all Avast's fault.  Thanks for your help, though.
    Monday, April 04, 2016 9:00 PM
  • Any way to tell what Avast was doing?  Shouldn't it simply flag the app and refuse to run it.  Is there a log somewhere of what Avast did.

    Sorry no personal experience, but IIRC posts of people affected, seem to indicate, that there is no notification, which is weird.

    With kind regards

    Monday, April 04, 2016 9:07 PM