Problems and solutions for using the remote debugging environment for Linux apps in Visual Studio 2017

Introduction

I have left some problems that occurred when using the previously created article (remote debugging of Linux apps in Visual Studio 2017) environment and some solutions. I think this.

Can't compile

Cause

It seems that a compile error occurred because the necessary files could not be found at build time due to reasons such as updating the GNU C library.

solution

The problem was solved by updating / installing the GNU C library (libc) related items and then restarting. It seems to be the quickest to update the package with the following command.

sudo apt update
sudo apt upgrade

If you want to install only what you need individually, you can probably do less. (This may be over or under.)

sudo apt update
sudo apt install libc6-dev
sudo apt install libc6-amd64
sudo apt install libc6-dev-amd64
sudo apt install build-essential

Unable to execute code that requires root privileges

Cause

As the heading says. If you try to use pthread's FIFO scheduling, you will need root privileges. However, when it is executed in the environment of the previous article, it does not work as expected because it cannot be executed with root privileges.

solution

It's a rather brute force, but I've just allowed the root user for ssh connections. Changed "PermitRootLogin" in "/ etc / ssh / sshd_config" to "yes". Set the root user password with the following command

sudo passwd root

From the VS2017 side, add the one of the root user to the ssh connection destination, and use it thereafter.

I can't link static libraries

Cause

If "-l ◯◯" is described in the place described in the previous article, it will be described before the description of the source code to be compiled as a compile option. Therefore, it becomes impossible to link the library that must describe the library link option after the description of the source file to be compiled such as the math library.

solution

By adding "-l ○○" after "Project Properties"-> "Linker"-> "All Options"-> "Additional Dependent Files", it will be expanded after the description in the code file. You can compile without any problems. リンク.JPG

[reference] https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/#verbose

Recommended Posts

Problems and solutions for using the remote debugging environment for Linux apps in Visual Studio 2017
Remote debugging in Visual Studio (Linux)
Remote debugging with Visual Studio 2017
Enable the virtualenv Python virtual environment for Visual Studio Code
Problems and solutions when asked for MySQL db in Python 3
About the procedure for linking Visual Studio Code for Windows and WSL
Tips for using Selenium and Headless Chrome in a CUI environment
Let's do Linux System Programming with Visual Studio Code and Azure! (From helloworld to nginx development and remote debugging)
Steps to put dlib in Python Tools for Visual Studio and have fun
Data Science Workloads and RTVS in Visual Studio 2017
Settings for Python coding in Visual Studio Code
The story of building the fastest Linux environment in the world
Problems and countermeasures for Otsu's binarization overflow in Python
Command line collection for using virtual environment in Anaconda
AWS SDK for Python (Boto3) development in Visual Studio 2017
Completely disable mouse acceleration in the Linux desktop environment