in reply to cl.exe & _ansi.h
Will you please read A Practical Guide to Compiling C based Modules under ActiveState using Microsoft C++ and follow the instructions. If you do what it says there and it still won't work.....
You second example is just wrong. To compile hello.c with your INCLUDE and LIB env vars set, and the correct bits in your path all you need to do is:
cl hello.c
It should be that easy. Here is an approximation of what your PATH, LIB and INCLUDE env vars should look like:
C:\>set PATH Path=D:\Perl\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C: +\COREL50;C:\Program Files\SSH Communications Security\SSH Secure Shel +l ;C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin;C:\Program File +s\Common Files\Microsoft Shared\VSA\7.0\VsaEnv C:\>set LIB LIB=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\;d: +\tools\cl\lib\ C:\>set INCLUDE INCLUDE=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\inc +lude\;d:\tools\cl\include\ C:\>cl hello.c Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.00.9466 for 80 +x86 Copyright (C) Microsoft Corporation 1984-2001. All rights reserved. hello.c Microsoft (R) Incremental Linker Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. /out:hello.exe hello.obj C:\>hello Hello World
Here is a quick explanation of the various bits you are seeing in the command line of a linked widget like the embedded interpretter that this is all about:
cl.exe -DWIN32 -I"C:\Perl\lib\CORE" C:\Perl\lib\CORE\perl58.lib -o int +erp.exe interp.c 1 2 3 4 5 + 6
Here is a snippet from perl.c
#if defined(WIN32) incpush(PRIVLIB_EXP, TRUE, FALSE); #else incpush(PRIVLIB_EXP, FALSE, FALSE); #endif
When we compile with -DWIN32 the WIN32 token will be defined, so the first incpush() will be compiled, while the second is simply stripped and ignored. If the WIN32 token is not defined then the reverse will happen.
cheers
tachyon
|
|---|