# Using cl.exe for 32 and 64 bits

**URL:** https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905
**Category:** Windows
**Created:** [January 18, 2019, 12:43am UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905 "2019-01-18T00:43:49Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![yancouto](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/yancouto/32/1001_2.png) [@yancouto](https://travis-ci.community/u/yancouto)
#### Post date: [January 18, 2019, 12:43am UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905/1 "2019-01-18T00:43:49Z")

</div>

Hi!

I was trying to build my project for both 32 and 64 bits. After a lot of work (I’m not familiar with developing on Windows) I figured out I should use the VS compiler (cl.exe), and to be able to compile to both 32 and 64 bits I should run the `vcvars32.bat` and `vcvars64.bat` script (inspired by [this](https://www.appveyor.com/docs/lang/cpp/)).

However, even though `visualstudio2017buildtools` is installed by default, it seems this bat files are not included. I managed to get them by installing more packages with `choco install -y visualstudio2017community visualstudio2017-workload-nativecrossplat`. This worked in the end ([see commit](https://github.com/uspgamedev/luasteam/commit/7592a6fc0d591e66b1d47e24f1bd6e290ae9b346)), but it takes about 10 minutes for Travis to run this (in comparison, the Linux and OSX builds take about 1 minute [see here](https://travis-ci.org/uspgamedev/luasteam/builds/481142802))

My question is: Is there a better and faster way to do this? This solution seems pretty hacky.

Thanks

---

<div class="post-metadata">

### Author: ![DanEngelbrecht](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danengelbrecht/32/1020_2.png) [@DanEngelbrecht](https://travis-ci.community/u/DanEngelbrecht)
#### Post date: [January 20, 2019, 4:02pm UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905/2 "2019-01-20T16:02:36Z")

</div>

I’d also like an answer to this. I have a stupid simple build setup for my project right now - I’m basically just running cl.exe on windows and it produces an executable file.

I’m unable find any way to get the path to cl.exe or the vcvars64.bat script.

Creating a project for msbuild just to get this going seems overkill when I just need access to cl.exe.

---

<div class="post-metadata">

### Author: ![JCash](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jcash/32/1059_2.png) [@JCash](https://travis-ci.community/u/JCash)
#### Post date: [January 26, 2019, 6:50pm UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905/3 "2019-01-26T18:50:48Z")

</div>

I was able to build using cl.exe after installing vctools like so:

```
choco install visualstudio2017-workload-vctools -y

```

It only took a couple of seconds.

My log: [https://travis-ci.org/JCash/containers/jobs/484798074](https://travis-ci.org/JCash/containers/jobs/484798074)

Edit:  
Interestingly, it seemed to find MSVC 2014?

```
"Using " C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
```

---

<div class="post-metadata">

### Author: ![devefx](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@devefx](https://travis-ci.community/u/devefx)
#### Post date: [January 28, 2019, 3:46am UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905/4 "2019-01-28T03:46:32Z")

</div>

using “/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat”

[https://docs.microsoft.com/en-us/cpp/build/setting-the-path-and-environment-variables-for-command-line-builds?view=vs-2017](https://docs.microsoft.com/en-us/cpp/build/setting-the-path-and-environment-variables-for-command-line-builds?view=vs-2017)

---

<div class="post-metadata">

### Author: ![DanEngelbrecht](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danengelbrecht/32/1020_2.png) [@DanEngelbrecht](https://travis-ci.community/u/DanEngelbrecht)
#### Post date: [January 30, 2019, 10:16pm UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905/5 "2019-01-30T22:16:14Z")

</div>

Huh, when I tried the install was minutes… will try again.

---

<div class="post-metadata">

### Author: ![JCash](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jcash/32/1059_2.png) [@JCash](https://travis-ci.community/u/JCash)
#### Post date: [January 30, 2019, 10:18pm UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905/6 "2019-01-30T22:18:26Z")

</div>

The original poster referred to another package than I did. Maybe that’s why it only took seconds for me?

---

<div class="post-metadata">

### Author: ![DanEngelbrecht](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danengelbrecht/32/1020_2.png) [@DanEngelbrecht](https://travis-ci.community/u/DanEngelbrecht)
#### Post date: [January 30, 2019, 11:23pm UTC](https://travis-ci.community/t/using-cl-exe-for-32-and-64-bits/1905/7 "2019-01-30T23:23:33Z")

</div>

Yeah, probably. Tested it and it fast and nice. Thanks!
