Programming - C++ - 'cl.exe' <- missing or can't find

misle

Diamond Member
Nov 30, 2000
3,371
0
76
I've been trying to get a compiler working for a friend of mine.

I've tried SharpDevelopment and MS Visual C++ 6.0

When attempting to compile and execute a "Hello World" program, but give me cl.exe errors.

Here is the message from Visual C++:
--------------------Configuration: Hello World - Win32 Debug--------------------
Compiling...
Hello World.cpp
d:\program files\microsoft visual studio\myprojects\hello world\hello world.cpp(4) : fatal error C1083: Cannot open precompiled header file: 'Debug/Hello World.pch': No such file or directory
Error executing cl.exe.

Hello World.obj - 1 error(s), 0 warning(s)


In #Development, it says that it is unable to find cl.exe and when I search my computer, I cannot find a file named cl.exe.

I'm running WinXP SP1.

Any ideas?
 

Childs

Lifer
Jul 9, 2000
11,313
7
81
Use gcc. Writing and compiling 4 line hello world programs should be the easiest thing in the world. The VC++ IDE always seems like a bunch of crap to me. Whatever happened to just having a editor and straight compiler?? Learning the IDE always seemed like more work than actually writing code.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Are you sure you installed MSVC properly? For me it is in C:\Program Files\Microsoft Visual Studio\VC98\Bin\CL.EXE

edit: IMHO, Childs is nuts. First off, MSVC produces faster code than gcc, which will matter if you start writing "real" code.

Secondly, using an IDE gives you cool features like autocompletion - for example, if you have a instance foo of a class which contains longName1, longName2, longName 3, and you type "foo.", it will autocomplete with the various options. It also lets you search for function/variable declarations and initializations easily.

Thirdly, the MSVC debugger is a fantastic tool. Once you understand how to use it (it really isn't hard), you'll be able to find problems VERY quickly and easily.

I used to feel the way Childs did - why should I have to create a whole freaking project and all these files just to write "Hello World", but once I moved on to anything with multiple files or even slightly complex, I realized how much better MSVC is.

It's also worth noting that it's difficult to find a text editor for Windows that does syntax highliting.
 

Kntx

Platinum Member
Dec 11, 2000
2,270
0
71
cl.exe is the linker. The IDE can't find the linker. Find her, and put her where she belongs!
 

misle

Diamond Member
Nov 30, 2000
3,371
0
76
I couldn't even figure out how or where to DL GCC.

OK, I did find the CL.exe (I didn't search after installing VC++, only after #Development), but how do I tell the compiler where to look?
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
I'd guess tools->options, directories tab, choose "executables" in the dropdown list, and make sure the directory is there. I really don't know why the installer didn't set that. I've never heard of it not working out of the box :confused:.
 

Childs

Lifer
Jul 9, 2000
11,313
7
81
Originally posted by: misle
I couldn't even figure out how or where to DL GCC.


hahahahahaha. At one time I had gcc running on Windows, but I wouldnt recommend it. I was just being facetious.

Isnt there a batch file you run to set up your environment for VC6? I thought I had to do something like that after the initial install.
 

darktubbly

Senior member
Aug 19, 2002
595
0
0
Perhaps this helps?

As far as faster/better code, I think your actual algorithm has a lot more to do with speed than the compiler.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: Childs
Originally posted by: misle
I couldn't even figure out how or where to DL GCC.
hahahahahaha. At one time I had gcc running on Windows, but I wouldnt recommend it. I was just being facetious.

Isnt there a batch file you run to set up your environment for VC6? I thought I had to do something like that after the initial install.
vcvars32.bat - doesn't affect the IDE though, just command-line stuff, as far as I know.

Originally posted by: darktubbly
As far as faster/better code, I think your actual algorithm has a lot more to do with speed than the compiler.
Algorithms take you from 1 week for a sort to 1 minute. Compilers take you from 1 minute to 50 seconds ;).

Regarding the PCH error, I didn't actually read the error message, just the question :eek:. You're right. The solution in that thread is the correct what. Whatever IRC network this "#Developers" channel is in is populated by people who don't know what they're talking about (or didn't read the whole message ;)).
 

misle

Diamond Member
Nov 30, 2000
3,371
0
76
I don't care about the compiler, as long as it works. It's actually for a friend of mine who is attempting to teach himself programming.