开发者

Compiling C++ programs [closed]

开发者 https://www.devze.com 2022-12-08 00:27 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_开发百科

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

Should I use Visual C++ Express to write and compile or should I write in Notepad++ and compile it? I like using Notepad++ because of its clean interface and speedy start-up as compared to Visual which is a considerably heavier program.

If I do write in Notepad++ how do I compile it using Visual?


Can just compile via the command-line.


Visual Studio has intellisense, which makes coding a LOT easier. I mean, there's really no comparison.


For successful developing in C++, you need much more than just compiling:

  • linking
  • "solution" management(to a project usually belongs more than 1 file)
  • resource management (for icons, bmp menu etc..)
  • debugging
  • easy jumping into functions/classes
  • intellisense (autocompletion for method/classes)

You will make more errors, produce worse code and will learn slower, if you use a simple texteditor.

Do yourself a favor and start with visual studio (or any other IDE). Later you can easily switch back to the basics (I doubt you will do that).


While it is possible to do all your work from the command line, it is easier to use Visual Studio's UI. It provide intellisense, easy configuration, integrated source debugging, searching, etc. Unless you are already an expert, I wouldn't recommend it.

If you are and you really want to use Notepad++, I would suggest using the Windows Platform SDK for a build environment (compiler + linker), and WinDbg for your debugger.


You can open up visual studio command prompt and run the command 'cl filename.c' to compile your program. However, this will help you only compile your program. If you want to debug it, you will have to open up a project under Visual Studio.


Notepad++ has less sophisticated tools management than some other text editors. For freely available alternatives, consider PSPad or ConTEXT. For paid alternatives, UltraEdit and EditPad Pro are nice.

All of them allow you to easily configure multiple external tools for compiling, building, etc.


If you really want to you can use both: you can let any solution item open in Npp: select 'Open With', then select to open the file with Npp and set this as default. This way, you'd use Npp for your editing needs, and still let VS manage the compiling/linking/.. No command line fiddling required.

That said, I use Npp as well, but apart from it's speed it's capabilities are nowhere near what VS offers, nor it's as customizable, and you can easily have VS look as clean as Npp.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号