如何使用*。o和*。d文件?

时间:2022-05-28 16:56:09

I ma trying to run examples using a library. In the documentation to the library it is written that I need to copy all the files into my directory and than type make. After that I need to go to the "Debug" folder and type ./lib_examples to run the examples.

我试图使用一个库来运行示例。在库的文档中,我需要将所有文件复制到我的目录中,而不是键入make。之后,我需要进入“Debug”文件夹并键入./lib_examples来运行这些示例。

I performed this sequence. As a result I have a lot of *.o and *.d files in the "Debug" subdirectory. Among them there is lib_examples.o and lib_examples.h files. But there is no lib_example file that I am supposed to execute.

我完成了这个序列。结果我有很多*。o和*。“调试”子目录中的d文件。其中有lib_example。o和lib_examples。h文件。但是这里没有我应该执行的lib_example文件。

Does anybody know what was supposed to happen and where it went wrong. Should I do one more step to be able to use *.o and *.d files?

有人知道应该发生什么吗,哪里出了问题吗?我应该多做一步才能使用*。o和*。d文件?

1 个解决方案

#1


8  

The ".o" files are likely intermediate files from which the actual executable program should have been created.

”。o“文件可能是创建实际可执行程序的中间文件。

The ".d" files are likely internal state used by the makefile, only important if you are making changes to the source code and then rebuilding "incrementally".

”。d"文件很可能是makefile使用的内部状态,只有当您对源代码进行更改然后“增量地”重新构建时才重要。

If, after running make, you have only these files but not the executable file, then the most likely explanation is that make encountered an error in creating the executable. If that's the case, then the last few lines of output generated by make should tell you more.

如果在运行make之后,您只有这些文件而没有可执行文件,那么最可能的解释是在创建可执行文件时遇到了错误。如果是这样,那么make生成的最后几行输出应该会告诉您更多信息。

#1


8  

The ".o" files are likely intermediate files from which the actual executable program should have been created.

”。o“文件可能是创建实际可执行程序的中间文件。

The ".d" files are likely internal state used by the makefile, only important if you are making changes to the source code and then rebuilding "incrementally".

”。d"文件很可能是makefile使用的内部状态,只有当您对源代码进行更改然后“增量地”重新构建时才重要。

If, after running make, you have only these files but not the executable file, then the most likely explanation is that make encountered an error in creating the executable. If that's the case, then the last few lines of output generated by make should tell you more.

如果在运行make之后,您只有这些文件而没有可执行文件,那么最可能的解释是在创建可执行文件时遇到了错误。如果是这样,那么make生成的最后几行输出应该会告诉您更多信息。