简体   繁体   中英

Header inclusion error when using C++ for Linux in Visual Studio 2022

I have created C++ console program targeting Linux from Visual Studio. I have virtual machine that is running Ubuntu. The goal over here is test out the working of Visual Studio for Linux and then create Shared Items project which can be used for Linux as well as Windows.

The program is simple Hello World program where I am trying to include header files provided by vendor. I am following the steps mentioned here and over here . Everything works fine and it prints Hello World in Linux terminal but as soon as I try to include other headers it does not compile. It does not show red lines under the #include but when I run the program in debug mode it gives no such file or directory error. Also, how can I link libraries(.so) file in Visual Studio. Do I follow the same procedure that is used for linking.lib files?

As mentioned it is simple code:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM