Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Compiling Windows Program

Name: Anonymous 2005-11-15 14:39

I have this source file:

#include <windows.h>

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: Anonymous 2005-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: Anonymous 2005-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: Anonymous 2005-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: Anonymous 2005-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: Anonymous 2005-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

What app does have the Win32 header files?

Name: Anonymous 2005-11-16 1:33

>>4

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.

Name: Anonymous 2005-11-16 1:33

>>6

Download the Platform SDK if you don't have windows.h

Name: Anonymous 2005-11-16 7:14

Goddammit guys I've become too wapanese. I keep reading that as "windows dot ecchi"

Name: Anonymous 2005-11-16 10:07 (sage)

>>9
you're not wapanese enough until you read "." as "dotto"

Name: Anonymous 2005-11-16 13:08

Gah. All these new compiler has .NET and MFC crap and takes up gigabytes of space. Do you know what version had just the Win32 stuff?

Name: Anonymous 2005-11-16 17:58

>>11

Get the commandline compiler from Borland and toss in the platform SDK from MS.

Name: Anonymous 2005-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: Anonymous 2005-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: Anonymous 2005-11-16 21:24

This is what I typed in
bcc32 -Ic:\Borland\bcc55\include -Lc:\Borland\bcc55\Lib goodbye.c

Name: Anonymous 2005-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++.

Name: 14 2005-11-16 23:29

Never mind...I googled

http://thecoadletter.com/article/0,1410,27343,00.html

Borland wins. ty

Name: Anonymous 2008-03-08 16:30

NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ITT

Name: Anonymous 2008-03-08 16:35

Just get Visual Studio Express edition and the Windows SDK.

Name: Anonymous 2008-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: Anonymous 2008-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.

Name: Anonymous 2008-03-08 19:29

Jesus Christ, just use mingw already.

Name: Anonymous 2008-03-08 19:46


C:\>dmc goodbye.c
link win,,,user32+kernel32/noi;


C:\>goodbye

Name: Anonymous 2008-03-08 20:08

ITT, Win32CreateWindow(
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

Name: Anonymous 2008-03-08 22:18

>>24
error: 72 arguments given, 84 expected

Name: Anonymous 2008-03-09 12:55


UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);

Name: Anonymous 2008-03-09 14:10

UNREFERENCED_PARAMETER(dwReserved1);
UNREFERENCED_PARAMETER(dwReserved2);
UNREFERENCED_PARAMETER(dwReserved3);
UNREFERENCED_PARAMETER(dwReserved4);
UNREFERENCED_PARAMETER(dwReserved5);
UNREFERENCED_PARAMETER(dwReserved6);
UNREFERENCED_PARAMETER(dwReserved7);
UNREFERENCED_PARAMETER(dwReserved8);
UNREFERENCED_PARAMETER(dwReserved9);
UNREFERENCED_PARAMETER(dwReserved10);
UNREFERENCED_PARAMETER(dwReserved11);
UNREFERENCED_PARAMETER(dwReserved12);
UNREFERENCED_PARAMETER(dwReserved13);
UNREFERENCED_PARAMETER(dwReserved14);
UNREFERENCED_PARAMETER(dwReserved15);
UNREFERENCED_PARAMETER(dwReserved16);
UNREFERENCED_PARAMETER(dwReserved17);
UNREFERENCED_PARAMETER(dwReserved18);
UNREFERENCED_PARAMETER(dwReserved19);
UNREFERENCED_PARAMETER(dwReserved20);
UNREFERENCED_PARAMETER(dwReserved21);
UNREFERENCED_PARAMETER(dwReserved22);
UNREFERENCED_PARAMETER(dwReserved23);
UNREFERENCED_PARAMETER(dwReserved24);
UNREFERENCED_PARAMETER(dwReserved25);
UNREFERENCED_PARAMETER(dwReserved26);
UNREFERENCED_PARAMETER(dwReserved27);
UNREFERENCED_PARAMETER(dwReserved28);
UNREFERENCED_PARAMETER(dwReserved29);
UNREFERENCED_PARAMETER(dwReserved30);
UNREFERENCED_PARAMETER(dwReserved31);
UNREFERENCED_PARAMETER(dwReserved32);
UNREFERENCED_PARAMETER(dwReserved33);
UNREFERENCED_PARAMETER(dwReserved34);
UNREFERENCED_PARAMETER(dwReserved35);
UNREFERENCED_PARAMETER(dwReserved36);
UNREFERENCED_PARAMETER(dwReserved37);
UNREFERENCED_PARAMETER(dwReserved38);
UNREFERENCED_PARAMETER(dwReserved39);
UNREFERENCED_PARAMETER(dwReserved40);
UNREFERENCED_PARAMETER(dwReserved41);
UNREFERENCED_PARAMETER(dwReserved42);
UNREFERENCED_PARAMETER(dwReserved43);
UNREFERENCED_PARAMETER(dwReserved44);
UNREFERENCED_PARAMETER(dwReserved45);
UNREFERENCED_PARAMETER(dwReserved46);
UNREFERENCED_PARAMETER(dwReserved47);
UNREFERENCED_PARAMETER(dwReserved48);
UNREFERENCED_PARAMETER(dwReserved49);
UNREFERENCED_PARAMETER(dwReserved50);
UNREFERENCED_PARAMETER(dwReserved51);
UNREFERENCED_PARAMETER(dwReserved52);
UNREFERENCED_PARAMETER(dwReserved53);
UNREFERENCED_PARAMETER(dwReserved54);
UNREFERENCED_PARAMETER(dwReserved55);
UNREFERENCED_PARAMETER(dwReserved56);
UNREFERENCED_PARAMETER(dwReserved57);
UNREFERENCED_PARAMETER(dwReserved58);
UNREFERENCED_PARAMETER(dwReserved59);
UNREFERENCED_PARAMETER(dwReserved60);
UNREFERENCED_PARAMETER(dwReserved61);
UNREFERENCED_PARAMETER(dwReserved62);
UNREFERENCED_PARAMETER(dwReserved63);
UNREFERENCED_PARAMETER(dwReserved64);
UNREFERENCED_PARAMETER(dwReserved65);
UNREFERENCED_PARAMETER(dwReserved66);
UNREFERENCED_PARAMETER(dwReserved67);
UNREFERENCED_PARAMETER(dwReserved68);
UNREFERENCED_PARAMETER(dwReserved69);
UNREFERENCED_PARAMETER(dwReserved70);
UNREFERENCED_PARAMETER(dwReserved71);
UNREFERENCED_PARAMETER(dwReserved72);
UNREFERENCED_PARAMETER(dwReserved73);
UNREFERENCED_PARAMETER(dwReserved74);
UNREFERENCED_PARAMETER(dwReserved75);
UNREFERENCED_PARAMETER(dwReserved76);
UNREFERENCED_PARAMETER(dwReserved77);
UNREFERENCED_PARAMETER(dwReserved78);
UNREFERENCED_PARAMETER(dwReserved79);
UNREFERENCED_PARAMETER(dwReserved80);

Name: Anonymous 2009-02-27 1:18

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Name: Anonymous 2009-03-06 10:14

/xnx!

Name: Anonymous 2010-12-22 6:31

Don't change these.
Name: Email:
Entire Thread Thread List