Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

TSE: How to compile C / C++ programs from within TSE using the Microsoft Visual Studio 2022 command line compiler cl.exe?

3 views
Skip to first unread message

knud van eeden

unread,
Feb 3, 2025, 4:44:02 PMFeb 3
to SemWare TSE Pro Text Editor
Hello,

FYI:

1. Compiler settings:

Extension=.c
Description=C: Knud: MicroSoft Visual Studio Compiler 64
Command=COMCPPMICROSOFTCL64.BAT &name& &ext& &fn& &drive& &path& &output&
Output=Tee Output, Run Hidden and Don't Prompt After Shell
 -Error=^{.*}({[0-9]#}) *:.*{{error}|{warning}.*}$
  Error: Options=
  Error: Extra line (default empty line)=
 -FileName=
  FileName: Options=
  FileName: Tag=1
 -Line=
  Line: Options=
  Line: Tag=2
 -Column=
  Column: Options=
  Column: Tag=
 -Message=
  Message: Options=
  Message: Tag=3
User Macro=

2. Create this batch file COMCPPMICROSOFTCL64.BAT and put it in your working TSE directory (all 1-liners)

---

@REM version 1.0.0.0.0

@REM [kn, ri, mo, 03-02-2025 20:30:56]

del %4:\%5\%1.exe

CD %4:\%5

CALL "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\cl.exe" /Fe%4:\%5\%1.exe %3 >>%6 2>&1

@ECHO.

COPY "%6" c:\temp\dddoutput.txt

@ECHO.

CD %4:\%5

@ECHO filename=%3 >%6

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\cl.exe" /Fe%4:\%5\%1.exe %3 >>%6 2>&1

@ECHO.

COPY "%6" c:\temp\dddoutput.txt

@ECHO.

@PAUSE

---

3. Load a C program into TSE
(similar for 32 bit then create a new batch file, run vcvars32.bat in it.
similar for C++, just change the 'Extension=' from C to C++ and create a 32 bits and 64 bits version by using that vcvars32.bat or vcvars64.bat in it. So at the end of the day 4 different .BAT files).

4. Choose this compiler from the list of compilers.

5. Run the compiler.

6. As usual you will see the error output (if any) in the lowest TSE window.

7. Tested successfully in TSE version 4.50 RC24

Inline image


with friendly greetings
Knud van Eeden


Reply all
Reply to author
Forward
0 new messages