编译语言基础知识

编程入门 行业动态 更新时间:2024-10-16 22:22:10
本文介绍了编译语言基础知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请,可能有人向我解释有关与类似C语言的工作的一些基本的东西呢?特别是在Windows?

  • 如果我想使用一些其他图书馆,有什么事我从图书馆需要什么?头文件h和..?

  • 什么是.dll和.dll.a之间的区别? .dll和.LIB? .dll和.EXE?什么是的.def?

  • 不要紧,怎么着图书馆编译的?我的意思是,它可以使用,在Windows上,++库由VC从MinGW的编译我的C code编译内一个C?

  • 要使用另一个库,什么是preferred方式?调用LoadLibrary()或#包括LT&;?>

  • 有一些库只提供源$ C ​​$ C或.dll - 如何使用这些库?难道我每次都重新编译他们,我重建我的项目?

  • 如何创建一个大的.exe文件?这是所谓的静态链接?

  • 如何包括一些随机文件到的.exe?说一个程序图标或启动的歌吗?

  • 如何分割我的巨大的.c成小的?我是否需要创建每一个部分的头文件,然后我包括与的WinMain()或main()的?

  • 部分
  • 如果有,需要另一个库,是有可能这两个成一个文件合并在一起库?比方说,python26.dll需要MSVCR90.DLL和Microsoft.VC90.CRT.manifest

  • 如果我没有免费的previously分配的内存会发生什么?这是将要清理如果程序(进程)死?

  • 那么,这么多的问题...感谢每一个信息!

    解决方案   

    1:如果我想使用一些其他图书馆,有什么事我从图书馆需要什么?头文件h和..?

    ...而且,通常是你作为参数传递到你的链接 *。LIB 文件。

      

    2:是什么.dll和.dll.a之间的差异。? .dll和.LIB? .dll和.EXE?什么是的.def?

    这可能是有用的:静态库,动态库文件,DLL入口点,报头......如何摆脱这种活着的

      

    3:它不管怎么着图书馆编译的?我的意思是,它可以使用,在Windows上,++库由VC从MinGW的编译我的C code编译内一个C?

    是的,这很重要。对于编译器之间的互操作,以正常的方式是使用C风格的(不是C ++ - 风格)API,具有良好定义的参数传递约定(如 __ STDCALL ),或使用COM接口。

      

    4:使用其他库,什么是preferred方式?调用LoadLibrary()或#包括LT&;?>

    的#include 为编译器(例如,以便它可以编译成库调用);和调用LoadLibrary (或者使用 *。LIB 文件)是运行时链接器/加载(使它可以替代这些库方法的实际地址到你的code):也就是你既需要

      

    5:有一些图书馆只提供源$ C ​​$ C或.dll - 如何使用这些库?难道我每次都重新编译他们,我重建我的项目?

    如果这是唯一的来源,那么你可以编译源(一次)到库中,然后(当你建立你的项目)链接到库(无需重新编译库)。

      

    6:如何创建一个大的.exe文件?这是所谓的静态链接?

    是的,编译所有这一切传递给链接器。

      

    7:如何加入一些随机文件到的.exe?说一个程序图标或启动的歌吗?

    定义,在一个特定的Windows的资源文件,这是由资源编译器的编译。

      

    8:我如何拆分我巨大的.c成小的?我是否需要创建每一个部分的头文件,然后我包括与的WinMain()或main()的?

    部分

      

    9:如果是需要另一个库出库,是否有可能将这两个合并成一个文件?比方说,python26.dll需求MSVCR90.DLL和Microsoft.VC90.CRT.manifest

    我不明白你的问题/例子。

      

    10:如果我不免费previously分配的内存会发生什么?这是将要清理如果程序(进程)死了?

    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!

    解决方案

    1: If I want to use some other library, what do I need from the library? Header files .h and ..?

    ... and, usually a *.lib file which you pass as an argument to your linker.

    2: What is the difference between .dll and .dll.a.? .dll and .lib? .dll and .exe? What is .def?

    This might be useful: Static libraries, dynamic libraries, DLLs, entry points, headers … how to get out of this alive?

    3: 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?

    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.

    4: To use another library, what is preferred way? LoadLibrary() or #include <>?

    #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.

    5: 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?

    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).

    6: How do I create one big .exe? Is this called "static linking"?

    Yes, compile everything and pass it all to the linker.

    7: How to include some random file into .exe? Say a program icon or start-up song?

    Define that in a Windows-specific 'resource file', which is compiled by the 'resource compiler'.

    8: 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()?

    Yes.

    9: 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

    I don't understand your question/example.

    10: What happens if I don't free previously allocated memory? Is this going to be cleaned up if the program (process) dies?

    Yes.

    更多推荐

    编译语言基础知识

    本文发布于:2023-11-28 13:50:50,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1642662.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:基础知识   语言

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!