Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
344 views
in Technique[技术] by (71.8m points)

c - How to compile x64 code with Visual Studio in command line?

I want to compile a simple hello-world-style program using the Windows command line.

cl file_name.c

is easy enough. Now I want to do the same thing in 64 Bit. What should I do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to use a version of the cl.exe compiler which emits x64 code. Which one depends a bit on your setup.

Let's consider the case you're on a 64 bit machine. For this you'll need to use the compiler which lives at

c:Program Files (x86)Microsoft visual Studio 10.0VCinamd64cl.exe

If you're on a 32 bit machine you'll need to use the cross compiler located at

c:Program FilesMicrosoft Visual Studio 10.0VCinx86_amd64cl.exe


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...