0

I'm building a CMake project in VSCode (Windows, w/ mingw64 GCC toolchain), and I'm trying to execute compiled binaries from VSCode's "Terminal" tab, where I've set up MSYS2's MINGW64 bash shell by adding:

"terminal.integrated.profiles.windows": {
    "msys mingw64": {
        "path": "C:/msys64/msys2_shell.cmd",
        "args": [
            "-defterm",
            "-here",
            "-no-start",
            "-mingw64"
        ]
    }
},

to the VSCode's settings JSON, according to @SodaCris suggestion.

However, I get multiple "unable to find XXX.dll" errors as the runtime library paths are not properly configured. How do I either 1) link to the absolute paths of the required libraries (as is the default in Linux) or 2) specify the runtime library path when using the terminal (which I assume would be configuring the way the shell is called from VSCode)

joaocandre
  • 1,621
  • 4
  • 25
  • 42
  • we're going to need a [mre]. https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#standard-search-order-for-unpackaged-apps – starball Jun 25 '23 at 08:57
  • "where I've set up MSYS2's MINGW64 bash shell using @SodaCris suggestion" - Please, add your configuration into the question post. On Stack Overflow a question post should be **self-contained**. Also, you need to provide **more details** about the error you get. – Tsyvarev Jun 25 '23 at 09:35
  • If the VSC shell is configured properly, the necessary DLLs should already be in PATH. Please add the configuration you're using to the question as text. Also add `echo $PATH` from the VSC terminal. – HolyBlackCat Jun 25 '23 at 09:50
  • @Tsyvarev I've added the snippet to add MSYS2's bash shell to VSCode. – joaocandre Jun 25 '23 at 15:43
  • @HolyBlackCat None of the project's build directories are in the `PATH` variable, which is kind of expected since I don't pass any of the them when calling the bash executable – joaocandre Jun 25 '23 at 15:45
  • Ah, so you're talking about your own DLLs, not those installed from MSYS2? – HolyBlackCat Jun 25 '23 at 18:44
  • I build multiple shared libraries on my project, as well as executables that link to them. They are placed under `/build`, but that is naturally not on the default path. MSYS2's bash shell already sets up ming64 paths by default – joaocandre Jun 25 '23 at 18:56
  • Though Python's libraries, which are installed and used for building, aren't still being properly found by the shell, at least when I run `ldd` on the compiled binaries. – joaocandre Jun 25 '23 at 19:03

0 Answers0