天天看點

Windows10 VS2017 C++編譯Linux程式

版權聲明:本文可能為部落客原創文章,若标明出處可随便轉載。 https://blog.csdn.net/Jailman/article/details/85326660

#include <cstdio>
#include <iostream>
#include "unistd.h"

using namespace std;

int main()
{
	while (true)
	{
		cout << "hello linux!" << endl;
		sleep(1);
	}
   
    return 0;
}
           

開啟Linux虛拟機,運作以上代碼,彈出連接配接框,輸入位址,使用者名和密碼,Linux需要安裝g++和GDB。

有一些庫和函數include之後vs會報錯,但是編譯可以正常進行。

vs2017持續打開一定時間後,會提示rsync.exe和devenv.exe需要聯網,這時允許之後,再看編輯提示,報錯消失……

繼續閱讀