Questions tagged [object-files]

An object file is the real output from the compilation phase.

An object file is the real output from the compilation phase. It's mostly machine code, but has info that allows a linker to see what symbols are in it as well as symbols it requires in order to work. (For reference, "symbols" are basically names of global objects, functions, etc.)

A linker takes all these object files and combines them to form one executable (assuming that it can, ie: that there aren't any duplicate or undefined symbols). A lot of compilers will do this for you (read: they run the linker on their own) if you don't tell them to "just compile" using command-line options. (-c is a common "just compile; don't link" option.)

293 questions
0
votes
1 answer

Is it Possible: Link object files, then link result to more object files?

I'm new to the linking and compilation process (if you've got good learning sources, please share!), and am playing around with makefiles. I apologize in advanced that the following sounds obvious. Say I compile 2 .o files, and then link them. Then,…
Fine Man
  • 455
  • 4
  • 17
0
votes
1 answer

SVN ignores .o file with svn add command even if I remove the .o from ignore-list

Before marking my question as duplicate and referring to this: svn doesn't commit .o files, but why? , I have to say I already checked the svn config file in AppData where ignore list is specified (I am using Windows). However, when I remove the .o…
Brunisboy
  • 123
  • 1
  • 19
0
votes
1 answer

Are Linux commands really C object files?

I was reading "The C Programming Language" by Kernighan & Ritchie and came across some programs which mimic some Unix commands (also implemented in Linux) such as the cat command. The program took command line arguments just like the original cat…
arghhjayy
  • 127
  • 1
  • 8
0
votes
1 answer

Where is an object file for 'stdio.h' in Windows?

I use Windows and Visual Studio 10.0 now. I was wondering where the object files for C standard library functions declared in stdio.h, string.h, etc. are located in Windows, so searched for an object file for 'stdio.h' but failed. As below, Files in…
Joon
  • 53
  • 1
  • 9
0
votes
3 answers

Templated function being reported as "undefined reference" during compilation

These are my files: --------[ c.hpp ]-------- #ifndef _C #define _C #include class C { public: template void call(CARTYPE& c); }; #endif --------[ c.cpp ]-------- #include "c.hpp" template void…
Nav
  • 19,885
  • 27
  • 92
  • 135
0
votes
1 answer

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…
Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147
0
votes
1 answer

Structure of COFF object files

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 to it, but still:…
Pyjong
  • 3,095
  • 4
  • 32
  • 50
0
votes
1 answer

Fatal Error when executing a Makefile

I am currently working on an assignment that requires me to build a Makefile that creates an include directory copies math330.h file into the include directory create a lib directory compile the .c files in trig and exp as object files make a…
Arby22
  • 13
  • 2
0
votes
0 answers

C++ Library Dynamically Linked to a Java Library

I'm writing a C++ plugin for an application. The plugin is a .o file. Call this code/functionality as being "C". I also wrote a Java library. Think of the code and functionality as being "J". Next I used JNI's Invocation API to allow C to call…
Mathematician
  • 380
  • 2
  • 9
0
votes
1 answer

Compiling a .cpp file with a .o (object file)

I was trying to use some sqlite3 and then I couldn't compile it with g++. I have learned from another question that said I have to make the sqlite3.c file into sqlite3.o file. I did that with gcc. Now I have my source code as test.cpp and sqlite3.o.…
0
votes
4 answers

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…
Chris Tonkinson
  • 13,823
  • 14
  • 58
  • 90
0
votes
1 answer

How to add object and header files to your NetBeans project?

I have some .o and .h files that I need to include in my another NetBeans IDE. So far, I have tried using this approach : C++ NetBeans: How to link my .o file to my project? When I open the add library file dialog, it does not show me any .o files…
0
votes
1 answer

Does the object file contain x86 code? How can we generate RISC-V code from an object file?

We have object files generated after compiling a code (not written in C/C++). Is it possible to generate equivalent RISC-V code from this object file? If so, how?
0
votes
2 answers

g++ using a object file in external directory

Context: I am current learning c/c++ compiling on my raspberry pi b+ model (started last week), but having trouble using a header file inside a object file. File locations: main.cpp - ~/src/c++/projects/web_server http_socket.o -…
Garry Mason
  • 33
  • 1
  • 8
0
votes
1 answer

Is it possible to import/run object files in eclipse?

Our professor made available object files of a previous assignment that I wasn't able to complete. This previous assignment is required for completing/testing the current assignment. Would it be possible somehow for me to import them into eclipse or…
AlldaRage
  • 121
  • 1
  • 1
  • 8