T. Webster
T. Webster

Reputation: 10109

debug C for UNIX API on Windows 7 with Cygwin?

I am just learning about Cygwin, and it appears to make possible to write C code against the UNIX API, and then have it run on Windows, provided you build it in the Cygwin environment.

I have gotten accustomed to the Visual Studio IDE and debugging tools, so wanted to ask: is it somehow possible to write and build C in Windows, and then debug it with Visual Studio, with the help of Cygwin?

Upvotes: 0

Views: 436

Answers (3)

T. Webster
T. Webster

Reputation: 10109

It is actually possible to debug UNIX apps with Visual Studio. See Utilities and SDK for Subsystem for UNIX-based Applications.

Upvotes: 1

Rabbit
Rabbit

Reputation: 566

Visual Studio isn't an option for your case because the VS collection of tools are designed to work with code compiled using the VS C compiler and not GCC. In lieu of Visual Studio, I suggest Codelite. It's designed specifically as a cross-platform IDE that will be familiar to developers that have migrated from Visual Studio. It will of course handle GCC or Clang.

In comparison to CodeBlocks (another potential IDE you can use), Codelite has a large number of features that are slightly improved, but it does have a few that are worth mentioning individually.

  • Clang driven code-completion and code tagging. This is separate from the compiler, so even when compiling with GCC the IDE can provide you with Clang-based features. As a word of caution, Clang supported features are not yet entirely implemented. For instance, Clang code suggestions aren't present, and code-completion doesn't yet work for Objective-C.
  • Partial support for Objective-C out of the box. CodeBlocks needs to be properly setup to correctly handle Objective-C projects, while Codelite can handle them without any modifications. I say partial support for Objective-C because of the aforementioned missing code-completion for Objective-C methods and classes.
  • Much higher quality build error output window; catalogues all build errors and warnings by message, file and project. The only thing I can directly compare it to is the build error output window in Xcode.

My suggestion is to try both IDEs and decide on which will better suit your needs.

Upvotes: 1

A T
A T

Reputation: 13826

No, because the VS debugging tools (for the most part) depend heavily on it being compiled using the MS C compiler, rather than GCC.

So if you manage to bootload it in, you won't get any of the more useful debugging features VS offers.

The closest alternative to Visual Studio that supports GCC is Eclipse.

Upvotes: 2

Related Questions