简体   繁体   English

Visual Studio 2017 linux c++ librt

[英]visual studio 2017 linux c++ librt

I've read, I can use Visual Studio 2017 on Windows to develop C++ application with remotely debugging on a Linux machine.我读过,我可以在 Windows 上使用 Visual Studio 2017 来开发 C++ 应用程序,并在 Linux 机器上进行远程调试。 I like this idea because I'm familiair with VS2017 for C# on Windows applications.我喜欢这个想法,因为我熟悉 VS2017 for C# on Windows 应用程序。

For my new study, I need to develop on Linux but for example must develope applications which use shared memory via Posix.对于我的新研究,我需要在 Linux 上进行开发,但例如必须开发通过 Posix 使用共享内存的应用程序。 So I need to include the LIBRT library.所以我需要包含 LIBRT 库。 But this one is specific for Linux, so if I need to use such kind of specific linux library's, could I then also use this VS2017 setup?但是这个是特定于 Linux 的,所以如果我需要使用这种特定的 linux 库,那么我是否也可以使用这个 VS2017 设置?

If how, how does that work because I did not find any information about it.如果如何,它是如何工作的,因为我没有找到任何有关它的信息。 Thx谢谢

I encountered the same obstacle but for libcurl.我遇到了同样的障碍,但对于 libcurl。 What fixed it was adding gcc arguments in the Visual Studio linker.修复它的是在 Visual Studio 链接器中添加 gcc 参数。 Right click the project and pick Properties->Linker->All Optptions->Additional Options and add the same parameter you would give to g++, in my case -lcurl .右键单击项目并选择Properties->Linker->All Optptions->Additional Options并添加与 g++ 相同的参数,在我的例子中是-lcurl I have also tested it for -pthread .我也对-pthread进行了测试。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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