Archived

This topic is now archived and is closed to further replies.

Win32 hworld on WinXP

This topic is 5706 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have been trying a hello world program written using Windows code, not C++ (printf("hello world") and I tried it on my computer with Windows XP. It didn't work (not surprised, XP has a shitload of problems). It does work on my other computer that has Windows 98 (Probably because XP is NTFS, not FAT32?) Heres my error: --------------------Configuration: win32_2 - Win32 Debug-------------------- Compiling... win32_2.cpp Command line error D2027 : cannot execute 'c1xx' Error executing cl.exe. win32_2.exe - 1 error(s), 0 warning(s) Heres the code: #define WIN32_LEAN_AND_MEAN #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { MessageBox(NULL, "\tHello, World!", "My First Windows Application", NULL); return 0; } If anyone can give me any help or direction in what to do, it will be greatly appreciated. [edited by - anarchyhl on June 1, 2002 7:48:42 PM]

Share this post


Link to post
Share on other sites
Maybe you could tell us how you''ve tried to do it, and what happens.

-Neophyte

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GED d- s:+ a- C++$ UL++ P++ L++ E W+ N+ o K? w !O M--(+) V-- PS+
PE Y+ PGP t-- 5++ X+ R(+) rv+(++) b+++ DI+ D(+) G e+>++ h r--> y+
----- END GEEK CODE BLOCK-----
geekcode.com

Share this post


Link to post
Share on other sites
heh...oops...

Heres my error:

--------------------Configuration: win32_2 - Win32 Debug--------------------
Compiling...
win32_2.cpp
Command line error D2027 : cannot execute ''c1xx''
Error executing cl.exe.

win32_2.exe - 1 error(s), 0 warning(s)


Heres the code:

#define WIN32_LEAN_AND_MEAN

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int

nShowCmd)
{
MessageBox(NULL, "\tHello, World!", "My First Windows Application", NULL);
return 0;
}

Share this post


Link to post
Share on other sites
Try creating a new project from scratch and move your source files in it.

Share this post


Link to post
Share on other sites
I had no problems compiling/running with VC++ .NET and VC++ 6.0 in WinXP.

/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/

Share this post


Link to post
Share on other sites
When you installed MSVC did you turn off your Norton Antivirus. Sometimes you have to turnoff it off while installing Micro$oft products.


-----------------------------
"There are ones that say they can and there are those who actually do."

"...u can not learn programming in a class, you have to learn it on your own."

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

Share this post


Link to post
Share on other sites
quote:
Original post by anarchyhl
Hello, I have been trying a hello world program written using Windows code, not C++ (printf("hello world") and I tried it on my computer with Windows XP. It didn''t work (not surprised, XP has a shitload of problems). It does work on my other computer that has Windows 98 (Probably because XP is NTFS, not FAT32?)

Heres my error:

--------------------Configuration: win32_2 - Win32 Debug--------------------
Compiling...
win32_2.cpp
Command line error D2027 : cannot execute ''c1xx''
Error executing cl.exe.

win32_2.exe - 1 error(s), 0 warning(s)


Heres the code:

#define WIN32_LEAN_AND_MEAN

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int

nShowCmd)
{
MessageBox(NULL, "\tHello, World!", "My First Windows Application", NULL);
return 0;
}


If anyone can give me any help or direction in what to do, it will be greatly appreciated.

[edited by - anarchyhl on June 1, 2002 7:48:42 PM]



what is "#define WIN32_LEAN_AND_MEAN" in there for?
i think thats your problem

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It tells the compiler not to include any MFC stuff from the windows headers.

Share this post


Link to post
Share on other sites
I had no problems with it.

usually because your running in debug mode, it won't let you run multiple instances of the program. I only get the "can't execute" because i've got the program already running the background. press ctrl-alt-del and make sure your program isn't running, also check your processes. I'm pretty sure it would run the first time, but after that it won't since it never closed down properly.

nfts and fat32? please, don't take what little knowledge you have about that and distort it. it's like saying "hey, my car won't start because my tire's flat."

[edited by - Pactuul on June 3, 2002 3:50:27 PM]

Share this post


Link to post
Share on other sites
I tried reinstalling and said one of the DLL''s were corrupted. Maybe one of you can upload the DLL''s FTP and I can download them? Oh yeah, before I check which ones they are, I want to make sure someones willing to do it.

Share this post


Link to post
Share on other sites
I have had similar probs with various programs I have compiled, try what pacctuul is saying, that has been my problem before.

I use XP and have no probs, what on earth made you think it was the file system?

Anyway good luck!

Im just a beginner!!!

http://www.actsofgord.com

[edited by - fatherjohn666 on June 3, 2002 12:32:22 AM]

Share this post


Link to post
Share on other sites