How to use an OBJ file?
I encountered a very interesting thing. Somebody开发者_JS百科 gave me only an OBJ file, even not C/C++ header file. But I have a few signatures of the functions in the OBJ file. Can I use only these signatures and obj file to Link the code in the OBJ file to my app?
If it works, how I can do it? I get not point now.
Thanks in advance!
During the link step, simply add the object file to the sources. How to do this varies with the compiler and linker used, but it may be as simple as adding it to the compilation command line.
Note that C++ uses different name-mangling rules from C, and you may need to use extern "C"
.
精彩评论