CL compile error

Started by bozo, August 19, 2005, 04:57:38 PM

Previous topic - Next topic

bozo

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?

GregL

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.


bozo

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

GregL

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.


OceanJeff32

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.
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

Vortex

Hi Jeff,

Try PellesC, another very good C compiler. The package comes with a detailed manual.

ToutEnMasm

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















 

hutch--

This is  how I build a C file in QE with the VCToolkit.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php