yesib0

yesib0

Hello everyone! I’m new here.

I’m trying to use KafkaEx in an app running on Windows 10 , but when I run mix deps.compile, I get an error related to the c++ compiler.

mix deps.get

Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  connection 1.1.0
  crc32cer 0.1.10
  kafka_ex 0.12.1
  kayrock 0.1.14
  varint 1.2.0
* Getting kafka_ex (Hex package)
* Getting kayrock (Hex package)
* Getting connection (Hex package)
* Getting crc32cer (Hex package)
* Getting varint (Hex package)
$ mix deps.compile

==> connection
Compiling 1 file (.ex)
Generated connection app
==> varint
Compiling 2 files (.ex)
Generated varint app
===> Fetching pc (from {git,"https://github.com/blt/port_compiler.git",{tag,"v1.10.2"}})
===> Analyzing applications...
===> Compiling pc
===> Compiling c:/omited_path/kafka_conn_app/deps/crc32cer/c_src/crc32c.c
===> **'cl.exe' is not recognized as an internal or external command,**
operable program or batch file.

==> kafka_conn_app
** (Mix) Could not compile dependency :crc32cer, "escript.exe "c:/Users/Yesid/.mix/rebar3" bare compile --paths c:/omited_path/kafka_conn_app/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile crc32cer", update it with "mix deps.update crc32cer" or clean it with "mix deps.clean crc32cer"

escript.exe is in the $PATH variable and rebar3 exists in the specified path.

I installed Visual Studio Community 2022 with the C++ compilers and ran the .bat file found here;
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat
That script sets all the environment variables necessary for the C++ compiler to run.
With this approach I was able to compile the KafkaEx dependency successfully, but I’m trying to find another way to compile it because it’s a bit of a hassle having to run that script every time I want to compile my application’s dependencies.

Elixir version: 1.13.0
Erlang/OTP 24

I really appreciate any help!
Thanks!

Showing Posts 1 to 3

cmo

cmo

You could write a mix alias which does that for you.

Or run it from within the VS developer console, though that’s probably no less hassle then running the script.

Or try using zig as your C compiler.

crispinb

crispinb

Whatever terminal app you use will somewhere have a place to configure the shell (cmd or powershell) startup. Just make sure the relevant vcvars*.bat file is run when starting up your shell.

I used the new Windows Terminal, configured in settings a profile to start with cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && pwsh.exe. That profile is now always equipped with the necessary paths. You could do something similar if you use cmd.exe rather than powershell.

yesib0

yesib0 OP

It worked, thanks!

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
widianto
I think I’ve found a small improvement I could contribute to <%= web_namespace %>.CoreComponents (installer/templates/phx_web/compo...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews