Unable to launch debugging in docker-based code-server - visual-studio-code

I first installed a code-server docker container on my Mac.
Then I installed g++ and gdb manually by running docker exec -it code-server /bin/bash
I wrote the following context in launch.json and task.json in/${workspaceFolder}/.vscode .[] []
I found out that it could be built normally, but debugging couldn't be launched.
By using "Terminal">"Run Build Task", the C++ source file could be compiled normally with creating an executable file. But when using "Run">"Start Debugging", it does nothing, including compile the source file.
1.I tried to delete the line "preLaunchTask": "build" and see if this went wrong. It didn't work.
2.I tried to use gdb and g++ manually, both of which normally.

Related

"gcc": executable file not found in %PATH% when using mongo-go-driver

I want to use mongodb driver.But I get the following error:
go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd
exec: "gcc": executable file not found in %PATH%
The issue is that your library depends on gcc to run.
1. Linux/Containers
If you are running in a container, you can try two options:
you can build your app without CGO with the following command:
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o yourBinary
You can try to install gcc into your container. If it is an alpine based container, run
RUN apk update && apk add --no-cache gcc
You could also need musl-dev package, but you should try without it first.
2. Windows
Since MacOS and most Linux distros come with GCC, I guess you could be using Windows. In this case, you need to install MinGW.
I know this is old but I ran into this problem too, About Alexey answer, on windows, you should install MinGW and add the path to win environment. You should follow this. In case MinGW did not work, you can install this one which worked perfectly for me on windows.

Visual Studio Code Debug Error with Delve Debugger

When debugging Golang on Mac machine using Visual Studio Code, or if you Upgraded your MacOS, you may see the following errors:
debugserver or lldb-server not found: install XCode's command line tools or lldb-server
or
could not launch process: exec: "lldb-server": executable file not found in $PATH
How to solve those debugging issues of vscode with delve?
Install command line developer tools by executing the following command:
xcode-select --install

Command line tools not accessible from Eclipse on OSX

I am using Eclipse on a macOS machine. CMake is present on my machine at /usr/local/bin/cmake and has been installed using Homebrew. Eclipse is at the latest version (2018-09).
I have the following target in a Makefile, which has been set up and is visible from Eclipse:
all:
./configure
Rscript -e "Rcpp::compileAttributes()"
R CMD INSTALL --no-multiarch --with-keep.source .
Inside the configure file, there is this code:
cd src/build;cmake ..
However, when I double click the all target in Eclipse, I get the following message:
make all
./configure
./configure: line 1: cmake: command not found
make: *** [all] Error 127
I remember that some time ago this target worked out of the box on macOS. I can also launch CMake from a terminal without any trouble.
echo $PATH shows different behaviour:
If called from a standard macOS terminal, it yields /usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
If called from a TM Terminal inside Eclipse, it yields /usr/bin:/bin:/usr/sbin:/sbin
What is the most canonical way to have Eclipse detect my CMake installation ?
For macOS High Sierra 10.13.6, the solution provided here works. This must be performed to see the changes immediately.

/bin/sh: mpic++ command not found in Eclipse for Parallel Application Developers

I'm trying to use Eclipse for Parallel Application Developers to do some MPI stuff but I can't get the program to compile. Below is the error I'm getting in the console:
Description Resource Path Location Type
/bin/sh: mpic++: command not found prog C/C++ Problem
I use mpic++ from the command line (bash shell) to successfully compile programs. When I run the command using bourne shell I get an error.
/bin/sh mpic++
/usr/local/bin/mpic++: /usr/local/bin/mpic++: cannot execute binary file
When I use sudo I still get the same error. But when I first change to the bourne shell then run the mpic++ command it works.
/bin/sh
sh-3.2$ mpic++
clang: error: no input files
I've been looking at ways to change the shell used by eclipse so I can use the bash shell because I can call mpic++ without any problems. I've also tried launching eclipse with sudo but that didn't work.
I have compiled mpi in eclipse successfully. Please follow the steps:
In terminal type:
$ which mpicxx
/usr/local/bin/mpicxx
You should get the mpicxx binary path as result. I have my mpicxx in /usr/local/bin/ directory.
In eclipse, go to project properties:
Set GCC C Compiler as: /usr/local/bin/mpicxx
Also set GCC C+ Compiler as: /usr/local/bin/mpicxx
Set MacOS X C++ Linker as: /usr/local/bin/mpicxx. Also set All options as -L/usr/local/lib

problem in configuring clang static analzer

i follow the following steps to install and configure clang static analyser.but still i could not run scan-build command in project directory can anyone can give correct tutorial to set path and also run scan-build command.terminal shows "scan-build command not found" the steps i followed:
Installation: Navigate to http://clang.llvm.org/StaticAnalysis.html Download the linked checker tarbell (it says tar.bz2, but it's really tar.bz2.tar). Extract that and copy that to a directory on your device. I chose ~/Developer/clang Open terminal and type sudo nano /etc/paths Enter the directory in which you keep your clang stuffs. Press 'Ctrl + X' to Exit, and press 'Y' to save.
You're now done with installation. Quit and restart terminal.
To use this, First make sure you go into Xcode and "Clean All" before you do anything. When that's all set, open terminal and navigate to the directory of the app you want to build. Enter the following command. Make sure to replace the name od the sdk with the one you currently want to build with. scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulator3.0
I've never added paths that way. But regardless you should not need to.
If you added clang to ~/Developer/clang, then just change the command you are using to run it to:
~/Developer/clang/scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulator3.0
Ran into this problem myself. It seems that scan-build is actually a perl script which changes some env variables so that clang compiler gets run before the work is passed to the real project compiler. This way clang can perform static analysis.
Try running like this:
perl <CLANG_PATH>/llvm/tools/clang/tools/scan-build/scan-build -k -o $HOME/clang-result make
Before that make sure you have the clang executable in the PATH variable:
echo $PATH
To add it:
export PATH=$PATH:<CLANG_BUILD_BIN_PATH>
eg: export PATH=$PATH:$HOME/clang/build/Release+Asserts/bin/