Questions tagged [cl]

cl.exe is a tool that controls the Microsoft C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio.

cl.exe is a tool that controls the Microsoft C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio.

301 questions
4
votes
0 answers

Regex alternation order differences between compilers

I'm using ECMA script syntax in c++ for input validation and have run into an issue when changing compilers. When using alternation, the first expression from the left to match should be used, unless disqualified by the rest of the regex. So, for…
Avi Ginsburg
  • 10,323
  • 3
  • 29
  • 56
4
votes
2 answers

C vs C++ using cl compiler in VS2015

How does the cl compiler know whether I'm compiling C or C++ code? Do I need to tell the compiler? I am running out of the Developer Command Prompt for VS2015. I originally started this project with c++ code that compiled and ran on a RedHat Linux…
E Purdy
  • 143
  • 1
  • 1
  • 9
4
votes
1 answer

A multithreading app compiled with MSVC fails at runtime

I've implemented a class that cyclically runs a supplied function. //Timer.h #include #include #include class Timer { public: Timer(const std::chrono::milliseconds period, const std::function& handler); …
tearvisus
  • 2,013
  • 2
  • 15
  • 32
4
votes
2 answers

How do I link a static library using cl.exe? (Specifying RuntimeLibrary)

cl -MT -DSFML_STATIC main.cpp freetype.lib gdi32.lib glew.lib jpeg.lib openal32.lib opengl32.lib sfml-audio-s.lib sfml-graphics-s.lib sfml-network-s.lib sfml-system-s.lib sfml-window-s.lib sndfile.lib winmm.lib The result…
KeyHeart
  • 163
  • 2
  • 6
  • 17
4
votes
1 answer

MsBuild ClCompile Output Format

TL;DR: In the following MsBuild output, what do the file names (sourceFile1.cpp ~ sourceFileX.cpp) that come after the cl command mean? (scroll down for a link to an actual log file) ClCompile: cl.exe
Azriel
  • 386
  • 2
  • 13
3
votes
2 answers

How to integrate Developer Command Prompt for VS 2022 as Terminal in VS Code

I would like to have the Microsoft VS C++ compiler cl available in VisualStudio Code. I have Visual Studio Build Tools installed and can call cl from the Developer Command prompt. The default way recommended by Microsoft to get VS Code to use the cl…
maddes8cht
  • 569
  • 3
  • 16
3
votes
2 answers

Why does powershell say cl.exe is not recognized?

I have visual studio installed, and cl.exe runs perfectly fine after vcvarsall.bat has been run in cmd but in powershell it says it is not recognized. cmd.exe C:\Users\Ethos>vcvarsall.bat…
Logos King
  • 121
  • 1
  • 6
3
votes
1 answer

Significant overhead for std::this_thread::sleep in MSVC 16.8.4?

In our render-loop we've always had a FPS limiter in the form of this_thread::sleep_until(Thisframe + milliseconds(1000 / 60)); but after compiling on the latest version the FPS never went above 32. So played around with the delay and found that any…
Convery
  • 183
  • 7
3
votes
1 answer

Common Lisp: Destructure a list in first, rest, last (like Python iterable unpacking)

Exercise 6.36 of David Touretzky's Common Lisp book asks for a function swap-first-last that swaps the first and last argument of any list. I feel really stupid right now, but I am unable to solve this with destructuring-bind. How can I do what in…
upgrd
  • 720
  • 7
  • 16
3
votes
2 answers

Statically link python37.dll and vcruntime140.dll when using cython --embed

Let's say I'm "cythonizing" this test.py: import json print(json.dumps({'key': 'hello world'})) with: cython test.py --embed call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 cl test.c /I C:\Python37\include /link…
Basj
  • 41,386
  • 99
  • 383
  • 673
3
votes
3 answers

C++ program not running on windows systems without VS installed "VCRUNTIME140.dll was not found"

When I compile a simple program: #include using namespace std; void main() { cout << "Hello world!"; } And tun the compiled .exe on another system without visual studio installed I receive the following error: The Code execution…
cdev
  • 31
  • 1
  • 2
3
votes
2 answers

To extern "C" or Not to extern "C" [g++ vs cl]

I'm comparing Numerical Recipes four1.c to Nayuki's FFT. Both are the C versions, but I'm using a C++ driver. For the comparison, I'm compiling (or more appropriately, linking) both into an executable with CL.exe and g++. The two appear to be…
KyleG
  • 143
  • 7
3
votes
1 answer

How to pass linker options to `cl` via MSVS 2017 x64 command line?

I have a small program which I want to execute via the command line. I run it from inside the IDE and it runs fine. I copy the entire compilation command and paste it on the MSVS command prompt and I get unresolved symbol linker errors (I have done…
KeyC0de
  • 4,728
  • 8
  • 44
  • 68
3
votes
1 answer

What is the alternative for cl /NODEFAULTLIB in gcc

I have done a c++ project that doesn't depend on any c/c++ runtime but only windows api I can build it easily with msvc by passing -NODEFAULTLIB to the linker and I end up with a small executable that doesn't depend on any c/c++ runtime I'm thinking…
dev65
  • 1,440
  • 10
  • 25
3
votes
1 answer

Windows linking to libcurl_a.lib

I built libcurl following the instructions for building libcurl as a static library in the curl/winbuild directory to the letter. It spat out a libcurl_a.lib, a collection of .h files, which I moved into folders that I promptly added to the PATH. I…
JordanOcokoljic
  • 357
  • 2
  • 14
1 2
3
20 21