是否有用于cygwin for nppexec编译C代码的脚本? [英] Are there any scripts for compiling C code with cygwin for nppexec?
问题描述
我目前正在学习用C语言编写代码,并且我使用Cygwin64来编译代码,到目前为止,我正在使用Notepad ++作为文本编辑器,并且希望能够使用插件nppexec而不是编译代码。必须关闭notepad ++,进行编译,然后再次将其打开。唯一的问题是,大多数C的nppexec脚本使用的是mingw而不是cygwin,是否有C的所有nppexec脚本的使用cygwin64?
I'm currently learning to code in C and I use Cygwin64 to compile the code, as of now I'm using Notepad++ as my text editor and I would like to be able to compile my code using the plugin nppexec instead of having to close notepad++, compile and then open it again. The only problem is that the majority of nppexec scripts for C use mingw and not cygwin, Are there any nppexec scripts for C that use cygwin64?
推荐答案
是否有用于cygwin for nppexec编译C代码的脚本?
Are there any scripts for compiling C code with cygwin for nppexec?
帮自己一个忙,学会使用命令行界面。
阅读 现代C 书。
避免在C源文件名中使用奇怪的字符(尤其是空格)。因此,请使用 foo-bar.c
或 foo_bar.c
,但不要使用 foo bar.c
(第二个 o
后有空格)。
Avoid weird characters (notably spaces) in C source file names. So use foo-bar.c
or foo_bar.c
but not foo bar.c
(with a space after second o
).
用于您的源代码编辑器,请考虑 GNU emacs 或 vim 或 Visual Studio代码(或其他一些 IDE )。但是请记住,大多数C 编译器程序(包括 tinycc , nwcc , GCC - cygwin
提供的-, C语,甚至 Visual Studio 本质上是它的 cl
命令)正在转换C 翻译单元(实际上是您的 foo.c
文件)转换为目标文件(例如Windows上的 foo.obj
, foo.o
(在Linux或MacOSX上),并且没有本机的任何GUI。稍后需要一些链接器。
For your source code editor, consider GNU emacs or vim or Visual Studio Code (or some other IDE of your choice). But remember that most C compiler programs (including tinycc, nwcc, GCC -which cygwin
provides-, Clang, even Visual Studio is at heart its cl
command) are transforming a C translation unit (practically your foo.c
file) into an object file (e.g. foo.obj
on Windows, foo.o
on Linux or MacOSX) and don't have natively any GUI for that. Later some linker is needed.
通过构建自动化工具进行编译,例如忍者或 GNU make 。
Compile thru a build automation tool such as ninja or GNU make.
在许多情况下,生成您的某些C代码(所谓的元编程方法)。调查诸如 SWIG , ANTLR , GNU野牛, rpcgen 或支持 ASN-1 在此处中列出。对于GUI界面,请考虑使用 GTK 和相关的代码生成器工具,例如 Ggen 。对于 JSONRPC 服务,请参见 jsvggen 。通过命令行界面方法,利用这些工具很容易。为了启发,还请看一下许多 bootstrapped 的开源代码 = https://en.wikipedia.org/wiki/Source-to-source_compiler rel = nofollow noreferrer>源到源编译器发出C代码,例如 Bigloo 或鸡/方案或 S48 。
In many cases, it is interesting to generate some of your C code (so called meta-programming approaches). Look into tools like SWIG, ANTLR, GNU bison, rpcgen, or those supporting ASN-1 listed here. For GUI interfaces, consider using GTK and related code generator tools, such as Ggen. For JSONRPC services, see jsvggen. With a command line interface approach, taking advantage of these tools is easy. Look also, for inspiration, into the open source code of many bootstrapped source to source compilers emitting C code, such as Bigloo or Chicken/Scheme or S48.
了解使用调试器,例如 GDB 或 LLDB 。调试信息(例如 DWARF )在编译时需要特殊标志,因此对于GCC,请使用 gcc -Wall -Wextra -g
获取警告和调试信息。
Cygwin 正在包装 GCC 编译器。
Learn to use a debugger, such as GDB or LLDB. Debugging information (e.g. DWARF) needs special flags at compilation time, so with GCC, use gcc -Wall -Wextra -g
to get warnings and debug info.
Cygwin is wrapping the GCC compiler.
用于 Arduino 或 RaspBerryPI 设备,C 交叉编译器也是命令行工具。
For embedded cross-compilation for Arduino or RaspBerryPI devices, the C cross-compiler is also a command-line tool.
当然,请阅读此处提到的每个工具的文档。
Of course, read the documentation of every tool mentioned here.
Cygwin受到 Unix 的启发,因此请注意 Unix哲学。
Cygwin is Unix inspired, so be aware of the Unix philosophy.
NppExec 是 Notepad ++ 的插件,该文档已在某处
NppExec is a plugin for Notepad++ which has its documentation somewhere.
PS。考虑考虑安装新手友好的 Linux发行版,例如 Debian 或 Ubuntu (如果您更喜欢原始版本:比其模仿版本更好的GNU / Linux发行版:Cygwin)。尝试之前,请务必备份您的重要数据。您将需要数百GB的磁盘空间来轻松使用,并且可能会有双重引导设置:Linux用于软件开发,Windows用于游戏。
PS. Consider perhaps installing a newbie-friendly Linux distribution such as Debian or Ubuntu on your PC laptop (if you prefer the original: a good GNU/Linux distribution to its imitation: Cygwin). Be sure to backup your important data before trying. You'll need a hundred gigabytes of disk space to be at ease, and you could have a dual boot setting: Linux for software development, Windows for games.
PPS:上面提到的每种软件(某些MicroSoft编译器除外)是开源,并且存在于Debian或Ubuntu上。 Linux From Scratch 可能会引起您的兴趣。另请阅读以获取信息本草案报告(2020年6月进行中)
PPS: every software mentioned above (except some MicroSoft compilers) is open source and exists on Debian or on Ubuntu. You could later be interested by Linux From Scratch. Read also for your information this draft report (work in progress in June 2020).
这篇关于是否有用于cygwin for nppexec编译C代码的脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!