object-files

Relation between object file and shared object file

what is the relation b/w shared object(.so) file and object(.o) file can you please explain via example Thanks in advance ...

What is the difference between .LIB and .OBJ files? (Visual Studio C++)

I know .OBJ is the result of compiling a unit of compilation and .LIB is a static library that can be created from several .OBJ, but this difference seems to be only in the number of units of compilation. Is there any other difference? Is it the same or different file format? I have come to this question when wondering if the same stati...

How do you get the initialized value of a global variable out of an object file?

If you have an object file, how do you get the initialized value of a global variable in that object file's data segment? For example, say I've done the following: # I'm interested in the variable foo inside bar.o in libbar.a: $ ar -x libbar.a bar.o $ nm --print-size bar.o | grep foo 00000048 00000004 D foo This tells me that foo is ...

Need help with understanding compilation of C++ programs..

Hi, I don't properly understand compilation and linking of C++ programs. Is there a way, I can look at object files generated by compiling a C++ program(in an understandable format). This should help me understand format of object files, how C++ classes are compiled, what information is needed by compiler to generate object files and he...

Automatically choosing object files for compilation

I have recently begun writing unit tests (using GoogleTest) for a C++ project. Building the main project is fairly simple: I use GCC's -MM and -MD flags to automatically generate dependencies for my object files, then I link all of the object files together for the output executable. No surpirses. But as I'm writing unit tests, is the...

How to put generated files (e.g. object files) into a separate folder when using Qt/qmake?

I have a Qt project that uses qmake. To improve clarity and readability, I'd like to keep the source files build system generated files (such as object files) separate. So my first step was putting the source files into a src/ sub directory: myproject/ myproject.pro src/ main.cpp MainWindow.ui ... ...

structure of object files

hi, i'm kinda having some issues with linking my assembly. I use NASM for assembly and then I link it with ld. One minor problem is that the GLOBAL directive only works if I define .data section which.. I believe has something reasonable behind it, but still how is that importnant for exporting symbols? (I decided to use coff since that ...

How to read the C++ CLI .obj files (result of compilation of a single file).

I have a small (<300 lines) C++ file in a C++ CLI project in Visual Studio 2010. I have crafted some macros which do different things depending on the Debug/Release configurations. I would like to be able to look at the resulting .obj files (when I compile in Debug and Release) and be able to compare the two. The hard part is that files...

Templated function being reported as "undefined reference" during compilation

These are my files: --------[ c.hpp ]-------- #ifndef _C #define _C #include<iostream> class C { public: template<class CARTYPE> void call(CARTYPE& c); }; #endif --------[ c.cpp ]-------- #include "c.hpp" template<class CARTYPE> void C::call(CARTYPE& c) { //make use of c somewhere here std::cout<<"Car"<<std::endl; } ...

.obj file conversion to OpenGL model header file - indices and f parameters?

The OpenGL model header file I'm working with contains definitions along the following: static const float modelVertices[NUM_OBJECT_VERTEX * 3] = {} static const float modelTexCoords[NUM_OBJECT_VERTEX * 2] = {} static const float modelNormals[NUM_OBJECT_VERTEX * 3] = {} static const unsigned short modelIndices[NUM_OBJECT_INDEX] = {} ...