久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Visual Studio 中的 Cygwin

Cygwin in Visual Studio(Visual Studio 中的 Cygwin)
本文介紹了Visual Studio 中的 Cygwin的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試將我為課堂編寫的舊程序從 Ubuntu 中的 KDev 移植到 Windows Visual Studio 2008,使用 Cygwin 作為個人學習練習.我將包含路徑配置為包含 C:cygwinusrinclude 但它沒有正確讀取 .h 文件.

I'm trying to port an old program I wrote for class from KDev in Ubuntu to Windows Visual Studio 2008 using Cygwin as a personal learning exercise. I have the include path configured to include C:cygwinusrinclude but it doesn't read the .h files properly.

也就是說,我很好奇如何在使用 Cygwin 的 Visual Studio 環境中使用 unix sockets.h 功能.有沒有人做過這個工作或有更簡單的方法來做這件事?

Namely I'm curious as to how one would go about using unix sockets.h functionality in a Visual Studio environment using Cygwin. Has anybody ever got this working or have an easier way to go about doing this?

推薦答案

有幾種方法可以解決這個問題,具體取決于您的確切目標.最簡單的方法可能只是創建一個 Visual Studiomakefile"項目,該項目觸發自定義構建命令來運行您構建的 makefile.但這使您無法享受 Visual Studio 作為 IDE 的許多好處,所以我猜這并不是您真正想要的.

There are several ways to go about this that could be made to work, depending upon your exact goals. The simplest way is probably just to create a Visual Studio "makefile" project that fires off a custom build command to run a makefile you've built. But that keeps you away from a lot of the nice benefits of Visual Studio as an IDE, so I'm guessing that's not really what you're after.

如果您想要一個更完全集成的解決方案,您需要做兩件事.首先,您將需要更改所有包含/庫路徑,以避免使用 Microsoft 路徑,轉而使用 Cygwin 路徑.您可以通過從菜單中選擇工具->選項",然后從出現的窗口左側的樹中選擇項目和解決方案->VC++ 目錄"來完成此操作.您可以選擇更改可執行文件、標頭、庫等的搜索目錄.對于您要執行的操作,我建議刪除所有內容并僅添加 cygwin 目錄.

If you want a more fully integrated solution, you're going to need to do two things. First of all, you're going to need to change out all of your include/library paths to avoid the Microsoft ones and go after the Cygwin ones instead. You can do this by selecting "Tools->Options" from the menu, then choosing "Projects and Solutions->VC++ Directories" from the tree on the left hand side of the window that comes up. You'll have options to change the search directories for executables, headers, libraries, etc. For what you're trying to do, I'd suggest removing everything and adding in just the cygwin directories.

其次,您必須告訴 Visual Studio 使用 gcc/g++ 編譯器.這有點棘手.VS 支持自定義文件類型的自定義構建規則……但它似乎為 Microsoft 編譯器硬連接了 C++.除了使用您自己的自定義文件擴展名之外,我真的不知道有什么好的方法可以解決這個問題.您可以嘗試 .c(C 文件)和 .cc(C++ 文件)的標準 unix 擴展名,但我懷疑 Visual Studio 會自動選擇這些.你可能不得不選擇完全陌生的東西.

Second, you'll have to tell Visual Studio to use the gcc/g++ compiler. This is a bit trickier. VS supports custom build rules for custom file types... but it seems to have C++ hardwired in for the Microsoft compiler. I don't really know a great way around that except to use your own custom file extension. You can try the standard unix extensions of .c (C files) and .cc (C++ files), but I suspect Visual Studio will automatically pick up on those. You may have to go with something totally foreign.

如果您在解決方案資源管理器中右鍵單擊您的項目并選擇自定義構建規則",您將獲得一個界面,讓您可以為您選擇的文件擴展名創建自定義構建規則.界面相對簡單.

If you right click on your project in the Solution Explorer and select "Custom Build Rules" you'll be given an interface that will let you create your custom build rules for the file extension you've chosen. The interface is relatively straightforward from there.

這可能無法完全滿足您的需求,但它可能與您使用 Visual Studio 獲得的效果差不多.

This might not get you exactly what you wanted, but it's probably about as close as you're going to get with Visual Studio.

這篇關于Visual Studio 中的 Cygwin的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

What do compilers do with compile-time branching?(編譯器如何處理編譯時分支?)
Can I use if (pointer) instead of if (pointer != NULL)?(我可以使用 if (pointer) 而不是 if (pointer != NULL) 嗎?)
Checking for NULL pointer in C/C++(在 C/C++ 中檢查空指針)
Math-like chaining of the comparison operator - as in, quot;if ( (5lt;jlt;=1) )quot;(比較運算符的數學式鏈接-如“if((5<j<=1)))
Difference between quot;if constexpr()quot; Vs quot;if()quot;(“if constexpr()之間的區別與“if())
C++, variable declaration in #39;if#39; expression(C++,if 表達式中的變量聲明)
主站蜘蛛池模板: 日韩亚洲视频 | 精品欧美二区 | 6996成人影院网在线播放 | 日韩欧美一区二区三区免费观看 | 一区二区三区四区在线视频 | 午夜精 | 欧美激情五月 | 999久久久久久久 | 狠狠婷婷综合久久久久久妖精 | 激情自拍偷拍 | 中文字幕一区二区三区四区 | 国产精品区二区三区日本 | 亚洲成人av | 久久亚洲一区二区三区四区 | 伊人爽| 国产日韩欧美在线一区 | 精品在线免费观看视频 | 99精品九九 | 久久久国产一区二区三区 | 国产丝袜一区二区三区免费视频 | 天天干精品 | 成人小视频在线观看 | 色婷综合网| 国产精品美女www爽爽爽视频 | 91久久久精品国产一区二区蜜臀 | www.久久.com | 九九久久国产 | 亚洲国产二区 | 精品不卡 | 日本成人免费网站 | 日韩欧美大片在线观看 | 欧美国产激情二区三区 | 天天干天天干 | 免费一区二区 | 国产午夜精品久久久久 | 色网在线观看 | 亚洲人人舔人人 | 97人人澡人人爽91综合色 | 激情五月综合 | 久久综合久久综合久久综合 | 日韩欧美手机在线 |