franneck94 / Vscode-C-Cpp-Runner

🚀 Compile, run and debug single or multiple C/C++ files with ease. 🚀
MIT License
53 stars 14 forks source link

[DOC] how to inject parameter like mariadb libs in cli #129

Closed utherbone closed 1 year ago

utherbone commented 1 year ago

Sorry, I don't know if this is the ideal place for this, but I haven't found a way to get in touch to ask how I can do this. I'm sorry, I didn't see this in the documentation for this extension for vscodium.

Below are the configuration files that I am using: .vscode (folder) -> c_cpp_properties.json (file) :

{
  "configurations": [
    {
      "name": "windows-clang-x64",
      "includePath": [
        "${workspaceFolder}/**"
      ],
      "compilerPath": "${workspaceRoot}/msys64/mingw64/bin/clang.exe",
      "cStandard": "${default}",
      "cppStandard": "${default}",
      "intelliSenseMode": "windows-clang-x64",
      "compilerArgs": [
        ""
      ]
    }
  ],
  "version": 4
}

.vscode (folder) -> settings.json (file) :

{
  "C_Cpp_Runner.cCompilerPath": "${workspaceRoot}/msys64/mingw64/bin/clang.exe",
  "C_Cpp_Runner.cppCompilerPath": "${workspaceRoot}/msys64/mingw64/bin/clang++.exe",
  "C_Cpp_Runner.debuggerPath": "${workspaceRoot}/msys64/mingw64/bin/lldb.exe",
  "C_Cpp_Runner.cStandard": "",
  "C_Cpp_Runner.cppStandard": "",
  "C_Cpp_Runner.msvcBatchPath": "",
  "C_Cpp_Runner.useMsvc": false,
  "C_Cpp_Runner.warnings": [
    "-Wall",
    "-Wextra",
    "-Wpedantic",
    "-Wshadow",
    "-Wformat=2",
    "-Wconversion",
    "-Wnull-dereference",
    "-Wsign-conversion",
    "-Wimplicit-function-declaration"
  ],
  "C_Cpp_Runner.enableWarnings": true,
  "C_Cpp_Runner.warningsAsError": false,
  "C_Cpp_Runner.compilerArgs": [],
  "C_Cpp_Runner.linkerArgs": [],
  "C_Cpp_Runner.includePaths": [],
  "C_Cpp_Runner.includeSearch": [
    "*",
    "**/*"
  ],
  "C_Cpp_Runner.excludeSearch": [
    "**/build",
    "**/build/**",
    "**/.*",
    "**/.*/**",
    "**/.vscode",
    "**/.vscode/**"
  ],
  "C_Cpp_Runner.useAddressSanitizer": false
}

The problem I'm having is that I don't know how to do it and where to put the parameter: $(mariadb_config --include --libs) In reality I don't even know if this is the best way to do this with clang, in MYSYS2 I installed libmariadbclient for clang.

I am using a standalone microenvironment with MSYS2 on Windows because the university's computers only have Windows.

franneck94 commented 1 year ago

I think this is not implemented currently. Maybe it works by adding it to the compilerArgs, but im not sure.

utherbone commented 1 year ago

Okay, I'm starting now, but if I can help with anything, I have another problem that I encountered, I don't know if there is anything related to extensions. I'll upload another issue.

It doesn't work, I already tried, it says it doesn't recognize the directory.

error: no such file or directory: '${mariadb_config}'

franneck94 commented 1 year ago

Yeah okay then this does not work. I also don't plan to implement this tbh