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
-1
votes
1 answer

C++ issue with class declared in a separate object file

I've got a problem when declaring a class in a separate object file and then using it in the main function of another file: main.cpp: #include using namespace std; int main() { Hello hi; hi.hello(); return…
asc11
  • 419
  • 3
  • 7
-1
votes
1 answer

Read In Points From OBJ File C++

I am trying to read in the following OBJ file #--- ObjWriter --- v -0.599972 -0.599972 -0.599972 v -0.304591 -0.834531 0.539150 . . . f 1 2 6 f 1 6 5 f 1 5 7 . . . I am trying to set up a function that will store the values of a vertex (3 values…
JMV12
  • 965
  • 1
  • 20
  • 52
-2
votes
1 answer

Difference between Data segment and Heap

could anybody please tell me if Data segment is the same as Heap segment, if not, could you please explain what's the difference between the two, i understand what's the difference between stack and heap, but in some books they evoke data segment as…
camelkos
  • 51
  • 5
-2
votes
1 answer

return only the image from an object file

I'm pulling a base64 encoded image from a server to a website and want to automatically use the image. The image comes within an object file and I'm not sure how to extract just the image from the object. Server send the object using (Node.js…
Ben Shan
  • 9
  • 4
-2
votes
4 answers

C programming basics: Why can't I see the .o file after I compile my .c file with gcc

I wrote a C programm and saved it with a .c extension. Then I compiled with the gcc but after that I only see my .c file and an .exe file. The program runs perfectly. But where is the .o file that I learned in theory? Has it been overwritten to .exe…
Marsstar
  • 159
  • 4
  • 10
-3
votes
1 answer

Generating an object file ( .o ) for a linker

I want to create a c program that creates .o files for the linker on my computer (ld). Gcc does this when I do the command gcc -c myfile.c. Are there any resources that show how to make an object file for a linker?
-3
votes
1 answer

SIze of .s file larger than .o file linux

I was compiling a program to find the maximum of numbers in an array. Edited I compiled it as follows: gcc --save-temps max.c -o max and then on doing ls -l max* the output was: -rwxrwxr-x 1 tapan tapan 7296 Aug 16 01:45 max -rw-rw-r-- 1 tapan…
tapananand
  • 4,392
  • 2
  • 19
  • 35
-5
votes
1 answer

How to compile class.cpp and class.hpp to one .o file?

How to compile class.cpp and class.hpp to one .o file? If I can, please tell me how. If I can't, please tell me what should I do if I want to do something similar. These are the latest version of my classes(they're not completed yet.):…
1 2 3
19
20