int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
return 0;
}
and I have the command-line compile tools. What do I enter to make it compile?
Name:
Anonymous2005-11-15 17:45
You want something along the lines of:
format C:
But seriously. What compiler are you using? Learn to read help files, and you learn the greatest thing of all.
Name:
Anonymous2005-11-15 17:49
I have the command-line compile tools
Go warez yourself some Visual Studio, you're obviously too stupid to use a command line and require a button to click - or even better a wizard with half a dozen buttons to click, one after the other.
Name:
Anonymous2005-11-15 19:10
I have the Visual Studio Command-line Compiler. I type cl goodbye.c and cl.exe can't find windows.h
What do I do to make it find windows.h or have all of you been using the IDE?
Name:
Anonymous2005-11-15 19:19
>>4
Does the free command-line version of VS include the Win32 header files? If it does, it's just a matter of using the library flag and referencing that directory.
Name:
Anonymous2005-11-15 20:09
>>5
I have Microsoft Visual C++ 2005 Express Edition and I searched the include directories and there were just standard C libs. No windows.h
Ok, you should *definitely* read the help files, 'cuz I could *swear* this shiat was in there. You haven't set up your environment properly. Look up environment vars like LIBPATH, LIBRARY, and INCLUDE. You need to set them properly.
Get the commandline compiler from Borland and toss in the platform SDK from MS.
Name:
Anonymous2005-11-16 20:15
>>12
do you have a link to the download? the borland site registration doesn't work and registration is annoying further more.
Name:
Anonymous2005-11-16 21:20
I compiled with the borland compiler and it gives me this error
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
goodbye.c:
Warning W8057 goodbye.c 8: Parameter 'hInstance' is never used in function WinMain
Warning W8057 goodbye.c 8: Parameter 'hPrevInstance' is never used in function WinMain
Warning W8057 goodbye.c 8: Parameter 'lpCmdLine' is never used in function WinMain
Warning W8057 goodbye.c 8: Parameter 'nCmdShow' is never used in function WinMain
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_main' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
BTW the compiler doesn't work with Cygwin. Otherwise it is a very nice. :)
Name:
Anonymous2005-11-16 21:24
This is what I typed in bcc32 -Ic:\Borland\bcc55\include -Lc:\Borland\bcc55\Lib goodbye.c
Name:
Anonymous2005-11-16 22:44
If you're having such major issues compiling, go get mingw. They provide a windows SDK as well. If you're finding it really hard, you can use Dev-C++, which is essentially mingw wrapped with a GUI and some goodies (you can download win32 headers from the Tools->Check for Updates).
If you're having a really really hard, buy (or pirate) a full copy of Visual C++.
Just get Visual Studio Express edition and the Windows SDK.
Name:
Anonymous2008-03-08 18:24
Visual Studio Express is only set up for you to use .Net with for GUIs, so it doesn't have the native headers. You need to d/l the Windows SDK for those.
There's probably a .bat file (vcvars.bat or something like that) in the SDK to set up the environment for you for the command line. Otherwise you have to dig around in VS Express to add the SDK location to the standard include and link paths.
Name:
Anonymous2008-03-08 18:33
set lib={location of your lib dir}
set include={location of your include dir}
set bin={location of your cl.exe and associated files}
cl /Ox /MD yourprogram.c /link /align:4096 /filealign:512 /merge:.rdata=.text /merge:.data=.text /section:.text,EWR
>>11
Google 'cl.exe + "Index of"' and get what you need. The compiler itself should only be around 5M, libs anywhere from 2-100M depending on what you need (likely not all of it), and the include files 2-25MB once again depending on what you need.