News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Using the Visual C toolkit

Started by Statix Star, January 05, 2005, 05:45:42 AM

Previous topic - Next topic

Statix Star

I had run cl, bit I got an error.
#include <stdio.h>
main()

{

        printf("Hello World!" \n");

        return 0;

}

Also, I downloaded lccwin32 but I don't know how to compile it.

Jibz

#include <stdio.h>

int main(void)
{
    printf("Hello World!\n");

    return 0;
}

Vortex

Hi Jibz,

Normally, a C compiler assumes that the return value of main is int by default, isn't it?


Vortex

Hi Jibz,

Thanks for the link  :U  It offers very usefull information.

Statix Star

http://www.robertjacobs.fsnet.co.uk/

I remember when I took this tutorials before, you don't need to use .h . .h are old header files.

Statix Star

I still got the same problem, no include path set in the stdio.h using the optimize c /c++compiler from MS.

Vortex

Hi Statix Star,

Did you set the environment variables with vcvars32.bat before running the compiler?
C:\Program Files\Vctoolkit>vcvars32.bat
Setting environment for using Microsoft Visual C++ 2003 Toolkit.
(If you have another version of Visual Studio or Visual C++ installed and wish
to use its tools from the command line, run vcvars32.bat for that version.)

Thank you for choosing the Visual C++ Toolkit 2003!  Get started quickly by
building the code samples included in the "Samples" directory.  Each sample
includes a short whitepaper discussing the Visual C++ features, and a batch
file for building the code.

Type "cl /?" for brief documentation on compiler options.

Visit http://msdn.microsoft.com/visualc/using/documentation/default.aspx for
complete compiler documentation.

C:\Program Files\Vctoolkit>cl Hello.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

Hello.c
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:Hello.exe
Hello.obj

C:\Program Files\Vctoolkit>hello
Hello World!

C:\Program Files\Vctoolkit>

Statix Star


noman9607

I had the same problem. Remember if you have both visual studio and the toolkit you have to run the right bat file....guess who did not do that? I guess I am stubborn but if I try to compile the old petzold examples from the command line I get a lot of errors like
"unresoved symbol" etc. It looks like a lot of the defines are not in the windef.h file. This same code runs fine on the ch interpreter and pelles c compiler and the lcc compiler. Has microsoft stopped supporting standard style c code for windows?