问题描述
请问有人可以向我解释一些关于使用C语言的基本事情吗?特别是在Windows上?-
如果我想使用其他图书馆,我需要从图书馆?头文件.h和..?
-
.dll和.dll.a有什么区别? .dll和.lib? .dll和.exe?什么是.def?
-
图书馆是如何编译的?我的意思是,是否可以在Windows上使用由MinGW编译的C代码中的VC编译的C ++库?
-
要使用另一个库,什么是首选方式?有一些只提供源代码或.dll的库 - 如何使用这样的库?LoadLibrary()或者#include 每次重建项目时,是否必须重新编译?
-
如何创建一个大的.exe?这被称为静态链接?
-
如何将一些随机文件包含到.exe中?说一个程序图标或启动歌曲?
-
如何将我的巨大的.c分割成较小的?我需要为每个部分创建一个头文件,然后我将其添加到WinMain()或main()的部分中。
-
如果有库这需要另一个库,是否可以将这两个组合到一个文件?说,python26.dll需要msvcr90.dll和Microsoft.VC90.CRT.manifest
-
如果我不释放以前分配的内存会发生什么?如果程序(进程)死亡,这会被清理吗?
那么这么多问题?感谢每一个信息!
...,通常是一个 *。lib
文件,您作为参数传递给您的链接器。
这可能很有用:
是的,这很重要。对于编译器之间的互操作,通常的方式是使用C风格(不是C ++风格)的API,具有明确的参数传递约定(例如 __ stdcall
),或使用'COM'接口。
#include
编译器(例如,它可以编译到库的调用);和 LoadLibrary
(或使用 *。lib
文件)用于运行时链接器/加载器(以便它可以将这些库方法的实际地址替换为您的代码):即您需要两者。
如果只是源码,那么可以将该源(一次)编译成一个图书馆,然后(当你建立你的项目)链接到那个库(没有重新编译库)。
是的,编译所有内容并将其全部传递给链接器。
定义在Windows特定的资源文件中,由'资源编译器'。
是的。
我不明白你的问题/示例。
是的。
please, could someone explain to me a few basic things about working with languages like C? Especially on Windows?
If I want to use some other library, what do I need from the library? Header files .h and ..?
What is the difference between .dll and .dll.a.? .dll and .lib? .dll and .exe? What is .def?
Does it matter how was the library compiled? I mean, is it possible to use, on Windows, a C++ library compiled by VC from within my C code compiled by MinGW?
To use another library, what is preferred way? LoadLibrary() or #include <>?
There are some libraries which only provide the source code or .dll - how to use such libraries? Do I have to recompile them every time I rebuild my project?
How do I create one big .exe? Is this called "static linking"?
How to include some random file into .exe? Say a program icon or start-up song?
How do I split my huge .c into smaller ones? Do I need to create for every part a header file which then I include in the part with WinMain() or main()?
If there is a library which needs another library, is it possible to combine these two into one file? Say, python26.dll needs msvcr90.dll and Microsoft.VC90.CRT.manifest
What happens if I don't free previously allocated memory? Is this going to be cleaned up if the program (process) dies?
Well, so many question... Thanks for every info!
... and, usually a *.lib
file which you pass as an argument to your linker.
This might be useful: Static libraries, dynamic libraries, DLLs, entry points, headers … how to get out of this alive?
Yes, it matters. For interop between compilers, the normal way is to use a C-style (not C++-style) API, with well-defined parameter-passing conventions (e.g. __stdcall
), or to use 'COM' interfaces.
#include
is for the compiler (e.g. so that it can compile calls to the library); and LoadLibrary
(or, using a *.lib
file) is for the run-time linker/loader (so that it can substitute the actual address of those library methods into your code): i.e. you need both.
If it's only source then you can compile that source (once) into a library, and then (when you build your project) link to that library (without recompiling the library).
Yes, compile everything and pass it all to the linker.
Define that in a Windows-specific 'resource file', which is compiled by the 'resource compiler'.
Yes.
I don't understand your question/example.
Yes.
这篇关于编译语言基础的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!