View Full Version : 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 <win32.mak>
..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
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 <win32.mak> .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
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 <win32.mak> .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
Tim Robinson
08-07-2003, 10:42 AM
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" <vcotirlea@hotmail.com> wrote in message
news:11e7a684.0308070611.25a64c36@posting.google.com... 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 <win32.mak> .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
Guest
08-08-2003, 10:58 AM
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'mbuilding the app using a makefile that looks like this at thebeginning:TARGETOS = BOTH!include <win32.mak>.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 Win98 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 (seeabove), 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 strangestuff, as the program runs on Win9x, so probably it's a setting in themakefile, 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
Tim Robinson
08-08-2003, 12:37 PM
"vc" <vcotirlea@hotmail.com> wrote in message
news:11e7a684.0308080103.3bf378cb@posting.google.com... 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/
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" <tim.at.gaat.freeserve.co.uk@invalid.com> wrote in message news:<bh11lg$tb441$1@ID-103400.news.uni-berlin.de>... "vc" <vcotirlea@hotmail.com> wrote in message news:11e7a684.0308080103.3bf378cb@posting.google.com... 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)?
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'mbuilding the app using a makefile that looks like this at thebeginning:TARGETOS = BOTH!include <win32.mak>.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 Win98 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 (seeabove), 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 strangestuff, as the program runs on Win9x, so probably it's a setting in themakefile, 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
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2008, Jelsoft Enterprises Ltd.