The MASM Forum Archive 2004 to 2012

Specialised Projects => Compiler Based Assembler => Assembler With Microsoft Visual C => Topic started by: bozo on August 19, 2005, 04:57:38 PM

Title: CL compile error
Post by: bozo on August 19, 2005, 04:57:38 PM
I just download visual c++ toolkit 2003 and was compiling some source code from the XP SP2 SDK in relation to COM.
The error from the command line i get is:

C:\Program Files\Microsoft Visual C++ Toolkit 2003>cl fire.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

fire.cpp
fire.cpp(619) : error C2065: 'COINIT_DISABLE_OLE1DDE' : undeclared identifier
fire.cpp(619) : error C2676: binary '|' : 'tagCOINIT' does not define this opera
tor or a conversion to a type acceptable to the predefined operator
fire.cpp(616) : error C3861: 'CoInitializeEx': identifier not found, even with a
rgument-dependent lookup


The undeclared identifiers are in objbase.h from the XP SP2 SDK, and i've put these include files into the include directory where CL.EXE is located, but still it doesn't seem to work.

I'm new to C++ and i apologise if this question is a bit lame.
Any ideas?
Title: Re: CL compile error
Post by: GregL on August 19, 2005, 06:51:04 PM
For include files you either need to use the /I CL option or set the INCLUDE environment variable to the include directory or directories.

For lib files you either need to use the /LIBPATH LINK option or set the LIB environment variable to the lib directory or directories.

A warning about the environment variables, MASM or other compilers will use them too.

For command-line compiling and linking, response files can be very handy.

Title: Re: CL compile error
Post by: bozo on October 02, 2005, 07:32:02 AM
Thanks for advice Greg, i did try that with other advice..but still didn't work.

I think it was something to do with the location of the SDK files i downloaded, because the toolkit
didn't have them by default..i just gave up.

using the vc++6 now, alot easier. :U
Title: Re: CL compile error
Post by: GregL on October 02, 2005, 07:09:14 PM
Don't give up. It does work if you get it set up right. The VC Toolkit 2003 is a very good compiler, it's the optimizing compiler that comes with Visual C++ .NET 2003 Professional.

Title: Re: CL compile error
Post by: OceanJeff32 on October 08, 2005, 09:09:27 AM
I too had given up on that FREE compiler, it's wonderful, but doesn't come with a manual! AND microsoft doesn't provide support for it.

what can you do, when you live in a shoe?

later,

jeff c
:U

Of course, that's when I really started to devote myself to assembly language.
Title: Re: CL compile error
Post by: Vortex on October 08, 2005, 09:23:43 AM
Hi Jeff,

Try PellesC, another very good C compiler. The package comes with a detailed manual.
Title: Re: CL compile error
Post by: ToutEnMasm on October 08, 2005, 01:41:55 PM
hello,
after some experiments with vctoolkit,i find that vctoolkit is'nt so different of masm32.
using environnement parameters:

PATH=C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin
INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;+SDK include path
LIB=C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;+ SDK lib path
CL=/Od /FAs /ZI /Zi                      ;going before all other's options
;make an asm /Od /FAs  informations for debugging  /ZI /Zi
;------ added by visual studio ------------------------------------------------------------------------
LIBVISUALSTUDIO=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
;------ cl don't need /link , it is in option

;command line parameters
cl /EHsc hello.cpp  libcpd.lib libcd.lib

comments

/EHsc is needed when using
   cout <<"evalua "<<a ;
   getch();
in your code.

Most of the vc++ samples can be compiled with this Environnement variables and a line like that

cl one.cpp two.c etc.cpp %LIBVISUALSTUDIO%

If you have a makefile , you can translate it in batch using nmake /N


                                             ToutEnMasm















 
Title: Re: CL compile error
Post by: hutch-- on October 22, 2005, 06:44:24 AM
This is  how I build a C file in QE with the VCToolkit.

[attachment deleted by admin]
Title: Re: CL compile error
Post by: Superhai on March 24, 2006, 02:06:13 AM
This should help if you need documentation for cl.exe

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_compiler_reference.asp