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

Saving to an object file in Java: getParentFile()

public void save() throws IOException { File f = new File(path); if (!f.getParentFile().exists()) { f.getParentFile().mkdirs(); } FileOutputStream fout = new FileOutputStream(f,…
user1680944
  • 537
  • 2
  • 13
  • 23
0
votes
2 answers

Converting from .obj to .h using Perl

I generated an obj file using blender, now I want to convert the object file to header file. I installed Perl and opj2opengl.pl but I don't know which command line I should use and what are the commands I should write. Some sites are suggesting to…
Ðina YŏŜri
  • 55
  • 2
  • 10
0
votes
1 answer

Archive files x32 or x64?

In C++, when you archive object files into a .a file, does it matter the platform? For example I'm on an x64 platform compiling with x64 compiler, I compile a bunch of CPP files into .o files. Using AR.exe, I archive them into a .a file and…
Brandon
  • 22,723
  • 11
  • 93
  • 186
0
votes
1 answer

How to link object files and libraries without using makefile

I would like to be able to compile a c++ source file without using a makefile. And here is a prototype of my problem... I have the following .cpp file // special libraries to include #include "acado.h" #include "auxiliary_functions.c" /*…
user2056096
  • 85
  • 1
  • 5
0
votes
1 answer

Create .lib file with c++ and Fortran / Call c++ code from Fortran / Unresolved external symbol

I am attempting to create a .lib library file that contains Fortran functions that call c++ functions, but I am getting the dreaded "error LNK2019: unresolved external symbol...". The code will eventually be compiled with a bunch of other libraries…
Das.Rot
  • 638
  • 4
  • 11
  • 25
0
votes
1 answer

can you link D object files with C object files?

Let's say I have two source files, one written in the D programming language and the other one written in the C programming language. I both just compile them, the D source with the DMD (Digital Mars D-Compiler) and the C source with the GCC…
Marnix v. R.
  • 1,638
  • 4
  • 22
  • 33
0
votes
1 answer

Makefile won't copy .o to obj/ and target to bin/ folders

I'm trying to write a Makefile which will copy its target and objects to bin/ and obj/ directories, respectively. Yet, when I try to run it I get the following error: nasm -f elf64 -g -F stabs main.asm -l spacelander.lst ld -o spacelander…
zeboidlund
  • 9,731
  • 31
  • 118
  • 180
0
votes
3 answers

Combining multiple .o files into an executable

I'm trying to combine object files created from C++ files into an executable using gcc. Unfortunately, gcc is giving me thousands of undefined reference errors to strings, arrays, etc. I am doing this on a Windows machine, so no terminal commands;…
calccrypto
  • 8,583
  • 21
  • 68
  • 99
0
votes
1 answer

cross compilation on ccs

I am supposed to build a project using neon intrinsic and since CCS doesn't support neon intrinsic, I am compiling the program on cygwin command line using GCC and will later link it on CCS. Now the problem is that I have got the object file . But I…
Prachi Chouksey
  • 153
  • 1
  • 1
  • 7
0
votes
1 answer

16-bit obj files VC++

How do I compile my VC++ project to a 16-bit flat object file for use in my bootloader I am working on? To my understanding, an object file is technically already "flat" and the linker turns it into the destination executable format. What I want it…
Cole Tobin
  • 9,206
  • 15
  • 49
  • 74
0
votes
2 answers

is header file path reference in .c file included in object file (.o)

I compile an example.c file that has the line: #include "parse/properties/properties.h" The compiler creates get an example.o file. Is the path to the header file included in the example.o file? or is that information external?
Olof
  • 5,348
  • 4
  • 25
  • 27
-1
votes
1 answer

Makefile automatically modifies rule after using the `touch` command, very weird case, anybody has some idea?

I am currently learning c++. I wrote the below Makefile to compile my program: NAME = test CC = c++ CFLAGS = -Wall -Wextra -Werror -std=c++98 SRCS = test.cpp OBJS = ${SRCS:.cpp=.o} all: ${NAME} %.o: ${SRCS} …
-1
votes
1 answer

Is there a name for converting machine code to object files?

I appreciate this might be a really dumb question. Is there a name for the process in which machine code gets laid out in an ELF file or Mach-O file? I’d like to know more about that process, but I’m unsure what to search for. ‘Linking’ seems to be…
Rol
  • 501
  • 4
  • 13
-1
votes
1 answer

Link Object File in Visual Studio LNK2019

right now I am trying to use a function of an object file in my visual studio project. The object file is native compiled and generated outside the visual studio project and now the final goal would be to call a function of it in my .cpp file. The…
linkerGuy
  • 1
  • 3
-1
votes
1 answer

C++ trying to receive Domain Sid with object file

I have a problem with the following code: std::string getDomainSid() { DWORD dw; //vector for the domain SID std::string myDomainSID; std::vector domainSID; std::wstringstream convertingDomainNameDNS; wchar_t…
lucade
  • 1
  • 1
1 2 3
19
20