When running my app I get "is not a valid Windows NT application" message - Programmer

This is a discussion on When running my app I get "is not a valid Windows NT application" message - Programmer ; Hi all, I have an app that should run on all OSes: 95, 98, ME, NT, 2k, XP. I'm building the app using a makefile that looks like this at the beginning: TARGETOS = BOTH !include ..cpp.obj: $(cc) $(cdebug) $(cflags) ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: When running my app I get "is not a valid Windows NT application" message

  1. When running my app I get "is not a valid Windows NT application" message

    Hi all,

    I have an app that should run on all OSes: 95, 98, ME, NT, 2k, XP. I'm
    building the app using a makefile that looks like this at the
    beginning:
    TARGETOS = BOTH
    !include
    ..cpp.obj:
    $(cc) $(cdebug) $(cflags) $(cvarsmt) -DSTRICT -YX\
    /GX\
    /D "TRACING"\
    -DNODEBUG $<


    The app built in this way worked nice on Win 2k and Win XP, but on Win
    98 I was getting the following error:
    "Expects a newer version of Windows. Upgrade your Windows version"

    Then I added the TARGETOS = BOTH before including win32.mak (see
    above), and then the program worked nice also on Win9x.

    Now on Win NT I got the error:
    "app.exe is not a valid Windows NT application".

    What can I do to make it to run on Win NT also? I don't use strange
    stuff, as the program runs on Win9x, so probably it's a setting in the
    makefile, but I don't know which one ... Maybe someone can help me ..

    Thanks a lot in advance,
    Viv

  2. Re: When running my app I get "is not a valid Windows NT application" message

    I forgot to mention the following:
    - The NT system has Service Pack 6a
    - The exe that runs on all platforms, except NT is built on Win 2k
    using VC++ 7.1
    - If I build the same sample on Win 98 using the same makefile and
    VC++ 6.0 it's working great on Win NT

    Please help,
    Viv

    vcotirlea@hotmail.com (vc) wrote in message news:<11e7a684.0308060909.58ea2862@posting.google.com>...
    > Hi all,
    >
    > I have an app that should run on all OSes: 95, 98, ME, NT, 2k, XP. I'm
    > building the app using a makefile that looks like this at the
    > beginning:
    > TARGETOS = BOTH
    > !include
    > .cpp.obj:
    > $(cc) $(cdebug) $(cflags) $(cvarsmt) -DSTRICT -YX\
    > /GX\
    > /D "TRACING"\
    > -DNODEBUG $<
    >
    >
    > The app built in this way worked nice on Win 2k and Win XP, but on Win
    > 98 I was getting the following error:
    > "Expects a newer version of Windows. Upgrade your Windows version"
    >
    > Then I added the TARGETOS = BOTH before including win32.mak (see
    > above), and then the program worked nice also on Win9x.
    >
    > Now on Win NT I got the error:
    > "app.exe is not a valid Windows NT application".
    >
    > What can I do to make it to run on Win NT also? I don't use strange
    > stuff, as the program runs on Win9x, so probably it's a setting in the
    > makefile, but I don't know which one ... Maybe someone can help me ..
    >
    > Thanks a lot in advance,
    > Viv


  3. Re: When running my app I get "is not a valid Windows NT application" message

    Hmm, I've created a VC++ project (.vcproj) and I've built my app using
    the IDE, not the makefile, and in this way it is working on Windows
    NT. This makes me be pretty sure that it is a makefile setting
    problem, but I still don't know which one ...
    Maybe somebody can give me a hint?

    Thx,
    Viv

    vcotirlea@hotmail.com (vc) wrote in message news:<11e7a684.0308060909.58ea2862@posting.google.com>...
    > Hi all,
    >
    > I have an app that should run on all OSes: 95, 98, ME, NT, 2k, XP. I'm
    > building the app using a makefile that looks like this at the
    > beginning:
    > TARGETOS = BOTH
    > !include
    > .cpp.obj:
    > $(cc) $(cdebug) $(cflags) $(cvarsmt) -DSTRICT -YX\
    > /GX\
    > /D "TRACING"\
    > -DNODEBUG $<
    >
    >
    > The app built in this way worked nice on Win 2k and Win XP, but on Win
    > 98 I was getting the following error:
    > "Expects a newer version of Windows. Upgrade your Windows version"
    >
    > Then I added the TARGETOS = BOTH before including win32.mak (see
    > above), and then the program worked nice also on Win9x.
    >
    > Now on Win NT I got the error:
    > "app.exe is not a valid Windows NT application".
    >
    > What can I do to make it to run on Win NT also? I don't use strange
    > stuff, as the program runs on Win9x, so probably it's a setting in the
    > makefile, but I don't know which one ... Maybe someone can help me ..
    >
    > Thanks a lot in advance,
    > Viv


  4. Re: When running my app I get "is not a valid Windows NT application" message

    Check the /SUBSYSTEM parameter passed to the linker.

    (Don't know where you'd set this in your makefile, though.)

    --
    Tim Robinson (MVP, Windows SDK)
    http://www.themobius.co.uk/

    "vc" wrote in message
    news:11e7a684.0308070611.25a64c36@posting.google.c om...
    > Hmm, I've created a VC++ project (.vcproj) and I've built my app using
    > the IDE, not the makefile, and in this way it is working on Windows
    > NT. This makes me be pretty sure that it is a makefile setting
    > problem, but I still don't know which one ...
    > Maybe somebody can give me a hint?
    >
    > Thx,
    > Viv
    >
    > vcotirlea@hotmail.com (vc) wrote in message

    news:<11e7a684.0308060909.58ea2862@posting.google.com>...
    > > Hi all,
    > >
    > > I have an app that should run on all OSes: 95, 98, ME, NT, 2k, XP. I'm
    > > building the app using a makefile that looks like this at the
    > > beginning:
    > > TARGETOS = BOTH
    > > !include
    > > .cpp.obj:
    > > $(cc) $(cdebug) $(cflags) $(cvarsmt) -DSTRICT -YX\
    > > /GX\
    > > /D "TRACING"\
    > > -DNODEBUG $<
    > >
    > >
    > > The app built in this way worked nice on Win 2k and Win XP, but on Win
    > > 98 I was getting the following error:
    > > "Expects a newer version of Windows. Upgrade your Windows version"
    > >
    > > Then I added the TARGETOS = BOTH before including win32.mak (see
    > > above), and then the program worked nice also on Win9x.
    > >
    > > Now on Win NT I got the error:
    > > "app.exe is not a valid Windows NT application".
    > >
    > > What can I do to make it to run on Win NT also? I don't use strange
    > > stuff, as the program runs on Win9x, so probably it's a setting in the
    > > makefile, but I don't know which one ... Maybe someone can help me ..
    > >
    > > Thanks a lot in advance,
    > > Viv




  5. Re: When running my app I get "is not a valid Windows NT application" message

    I suggest using Project->Export Makefile in the IDE (at least VC) to
    generate a makefile. I have trouble reading makefiles, especially one
    generated mechanically. But I think the effort would be worthwhile.

    I can't quite share my make files, but the following are extracts from
    a log file used for a Release build. All but one of my programs runs
    on 9x, NT, 2K, and XP. The settings may not be optimal, but are close.
    I don't use ATL or MFC, but include some of their include files for
    future use.

    The following is for compiling the resource file
    D:\progra~1\micros~1\Common\MSDev98\bin\rc.exe /l 0x409 /D "X86"
    /D "_X86" /D "WIN32" /D "_WINDOWS" /D NDEBUG /I "d:\work\IWrite" /I
    "d:\work\inc" /I "D:\progra~1\micros~1\VC98/include" /I
    "D:\progra~1\micros~1\VC98\mfc\include"
    /fod:\work\IWrite\Desktop\x86rel\IWrite.res d:\work\IWrite\IWrite.rc

    This next line is for compiling one source file
    D:\progra~1\micros~1\VC98\bin\cl.exe /D FOR_Desktop
    /nologo /D "STRICT" /Ob2 /D "WIN32" /D "_WINDOWS" /MT /D "X86" /D
    "_X86" /D "_MBCS" /FD /D NDEBUG /vms /GF /Gy /Oi /O2 /W3 /V
    "Copyright(c) 1998-2003 PenFact(TM), Inc. All Rights Reserved" /I
    "d:\work\inc" /I "D:\progra~1\micros~1\VC98\include" /I
    "D:\progra~1\micros~1\VC98\atl\INCLUDE" /I
    "D:\progra~1\micros~1\VC98\mfc\INCLUDE"
    /Fod:\work\IWrite\Desktop\x86rel\Remarks.obj /c
    d:\work\IWrite\Remarks.cpp

    The next line is for linking
    D:\progra~1\micros~1\VC98\bin\link.exe
    /LIBPATH:"d:\work\lib\Desktop"
    /LIBPATH:"D:\progra~1\micros~1\VC98\Lib"
    /LIBPATH:"D:\progra~1\micros~1\VC98\atl\lib"
    /LIBPATH:"D:\progra~1\micros~1\VC98\mfc\lib" libcmt.lib oldnames.lib
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
    advapi32.lib shell32.lib comctl32.lib /nodefaultlib /subsystem:windows
    /machine:I386 /incremental:no /OPT:REF /nodefaultlib
    /out:d:\work\IWrite\Desktop\x86rel\IWrite.exe
    d:\work\IWrite\Desktop\x86rel\IWrite.res
    d:\work\IWrite\Desktop\x86rel\LogBox.obj


    On 6 Aug 2003 10:09:23 -0700, vcotirlea@hotmail.com (vc) wrote:

    >Hi all,
    >
    >I have an app that should run on all OSes: 95, 98, ME, NT, 2k, XP. I'm
    >building the app using a makefile that looks like this at the
    >beginning:
    >TARGETOS = BOTH
    >!include
    >.cpp.obj:
    > $(cc) $(cdebug) $(cflags) $(cvarsmt) -DSTRICT -YX\
    > /GX\
    > /D "TRACING"\
    > -DNODEBUG $<
    >
    >
    >The app built in this way worked nice on Win 2k and Win XP, but on Win
    >98 I was getting the following error:
    >"Expects a newer version of Windows. Upgrade your Windows version"
    >
    >Then I added the TARGETOS = BOTH before including win32.mak (see
    >above), and then the program worked nice also on Win9x.
    >
    >Now on Win NT I got the error:
    >"app.exe is not a valid Windows NT application".
    >
    >What can I do to make it to run on Win NT also? I don't use strange
    >stuff, as the program runs on Win9x, so probably it's a setting in the
    >makefile, but I don't know which one ... Maybe someone can help me ..
    >
    >Thanks a lot in advance,
    >Viv


    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret
    PenFact, Inc.
    500 Harrison Ave., Suite 3R
    Boston, MA 02118
    www.penfact.com

  6. Re: When running my app I get "is not a valid Windows NT application" message

    "vc" wrote in message
    news:11e7a684.0308080103.3bf378cb@posting.google.c om...
    > In win32.mak the $(conlflags) is:
    > conlflags = $(lflags) -subsystem:console,$(EXEVER)
    >
    > so the subsystem *is* specified ...
    >
    > Any other idea?


    What's the value of $(EXEVER)?

    --
    Tim Robinson (MVP, Windows SDK)
    http://www.themobius.co.uk/



  7. Re: When running my app I get "is not a valid Windows NT application" message

    It's value is 4.10 and this is set in win32.mak that contains:
    # Windows 98 needs subsystem version set to 4.10 for version 5.0
    features.
    !IF ("$(APPVER)" == "5.0") && (("$(TARGETOS)" == "BOTH") ||
    ("$(TARGETOS)" == "WIN95"))
    EXEVER = 4.10
    !ELSE
    EXEVER = $(APPVER)
    !ENDIF

    Do you think that the EXEVER could be the problem? How?
    Thx,
    Viv



    "Tim Robinson" wrote in message news:...
    > "vc" wrote in message
    > news:11e7a684.0308080103.3bf378cb@posting.google.c om...
    > > In win32.mak the $(conlflags) is:
    > > conlflags = $(lflags) -subsystem:console,$(EXEVER)
    > >
    > > so the subsystem *is* specified ...
    > >
    > > Any other idea?

    >
    > What's the value of $(EXEVER)?


  8. Re: When running my app I get "is not a valid Windows NT application" message

    Thanks for your reply, but I'm using the VC++ 7.1 which doesn't have
    the "export makefile" option anymore ... So I can not export the
    makefile.

    Also, even if I would have VC++ 6, still the generated makefile is not
    dependant on the win32.mak, and the makefile that I have is dependant
    on win32.mak ...

    Viv

    r_z_aret@pen_fact.com wrote in message news:<3f33db89.20116616@nntp.theworld.com>...
    > I suggest using Project->Export Makefile in the IDE (at least VC) to
    > generate a makefile. I have trouble reading makefiles, especially one
    > generated mechanically. But I think the effort would be worthwhile.
    >
    > I can't quite share my make files, but the following are extracts from
    > a log file used for a Release build. All but one of my programs runs
    > on 9x, NT, 2K, and XP. The settings may not be optimal, but are close.
    > I don't use ATL or MFC, but include some of their include files for
    > future use.
    >
    > The following is for compiling the resource file
    > D:\progra~1\micros~1\Common\MSDev98\bin\rc.exe /l 0x409 /D "X86"
    > /D "_X86" /D "WIN32" /D "_WINDOWS" /D NDEBUG /I "d:\work\IWrite" /I
    > "d:\work\inc" /I "D:\progra~1\micros~1\VC98/include" /I
    > "D:\progra~1\micros~1\VC98\mfc\include"
    > /fod:\work\IWrite\Desktop\x86rel\IWrite.res d:\work\IWrite\IWrite.rc
    >
    > This next line is for compiling one source file
    > D:\progra~1\micros~1\VC98\bin\cl.exe /D FOR_Desktop
    > /nologo /D "STRICT" /Ob2 /D "WIN32" /D "_WINDOWS" /MT /D "X86" /D
    > "_X86" /D "_MBCS" /FD /D NDEBUG /vms /GF /Gy /Oi /O2 /W3 /V
    > "Copyright(c) 1998-2003 PenFact(TM), Inc. All Rights Reserved" /I
    > "d:\work\inc" /I "D:\progra~1\micros~1\VC98\include" /I
    > "D:\progra~1\micros~1\VC98\atl\INCLUDE" /I
    > "D:\progra~1\micros~1\VC98\mfc\INCLUDE"
    > /Fod:\work\IWrite\Desktop\x86rel\Remarks.obj /c
    > d:\work\IWrite\Remarks.cpp
    >
    > The next line is for linking
    > D:\progra~1\micros~1\VC98\bin\link.exe
    > /LIBPATH:"d:\work\lib\Desktop"
    > /LIBPATH:"D:\progra~1\micros~1\VC98\Lib"
    > /LIBPATH:"D:\progra~1\micros~1\VC98\atl\lib"
    > /LIBPATH:"D:\progra~1\micros~1\VC98\mfc\lib" libcmt.lib oldnames.lib
    > kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
    > advapi32.lib shell32.lib comctl32.lib /nodefaultlib /subsystem:windows
    > /machine:I386 /incremental:no /OPT:REF /nodefaultlib
    > /out:d:\work\IWrite\Desktop\x86rel\IWrite.exe
    > d:\work\IWrite\Desktop\x86rel\IWrite.res
    > d:\work\IWrite\Desktop\x86rel\LogBox.obj
    >
    >
    > On 6 Aug 2003 10:09:23 -0700, vcotirlea@hotmail.com (vc) wrote:
    >
    > >Hi all,
    > >
    > >I have an app that should run on all OSes: 95, 98, ME, NT, 2k, XP. I'm
    > >building the app using a makefile that looks like this at the
    > >beginning:
    > >TARGETOS = BOTH
    > >!include
    > >.cpp.obj:
    > > $(cc) $(cdebug) $(cflags) $(cvarsmt) -DSTRICT -YX\
    > > /GX\
    > > /D "TRACING"\
    > > -DNODEBUG $<
    > >
    > >
    > >The app built in this way worked nice on Win 2k and Win XP, but on Win
    > >98 I was getting the following error:
    > >"Expects a newer version of Windows. Upgrade your Windows version"
    > >
    > >Then I added the TARGETOS = BOTH before including win32.mak (see
    > >above), and then the program worked nice also on Win9x.
    > >
    > >Now on Win NT I got the error:
    > >"app.exe is not a valid Windows NT application".
    > >
    > >What can I do to make it to run on Win NT also? I don't use strange
    > >stuff, as the program runs on Win9x, so probably it's a setting in the
    > >makefile, but I don't know which one ... Maybe someone can help me ..
    > >
    > >Thanks a lot in advance,
    > >Viv

    >
    > -----------------------------------------
    > To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
    >
    > Robert E. Zaret
    > PenFact, Inc.
    > 500 Harrison Ave., Suite 3R
    > Boston, MA 02118
    > www.penfact.com


+ Reply to Thread