I have the following question: I was given the task - to build an application. There was a ready file counter.h and some other file - counter.obj. It turned out that in the counter.h there were only declarations of the functions - how can I include .obj file into the .cpp file so that it compiles? I am using Microsoft Visual Studio 2010 - and in which folder should the file itself go?
Files in OBJ format can be opened with Autodesk Maya 2013, Blender, and MeshLab in Microsoft Windows, Mac OS, and Linux platforms.
Object files contain relocatable machine code that is generated from your source code. Visual Studio creates one . obj file per each .
8.3. The assembler is used to convert an assembly file into an object file (. obj extension). The assembly optimizer and the compiler are used to convert, respectively, a linear assembly file and a C file into an object file. The linker is used to combine object files, as instructed by the linker command file (.
Just install the software OBJ Viewer To begin viewing 3D files, simply do the following Install the extension OBJ Viewer Click on the extension icon Choose the 3D file you wish to open Begin viewing your 3D files online today! This 3D viewer works for both STL and OBJ file formats.
Add the obj-file to the Solution just as you would do with cpp-files (i usually do this by drag-and-drop, that is, drag the file from the Windows Explorer and drop it on a project in the Solution Exporer window).
You can put the obj-file together with cpp-files; it doesn't really matter.
You do cannot include object file in to a cpp file.
The compiler compiles the cpp file and generates the obj files, for each cpp file, these files are further linked together to create an libray or an executable.
Usually, you would link libraries(.lib
or .dll
) to an Application, Check if those are with you.
If not,
You can try linking the object file to your application by:
Go to project properties then from "Property Page"
select the node "C/C++"
their you will get "Additional Include Directories"
add the name of your object file.Keep your obj file in the directory where your source code is or you can add the directory from:Tools->Options->Projects and Solutions->VC++Directories
.
I have never tried the second method except for academic projects,which was years ago, So not sure about it, Please check information on MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With