User forums > General (but related to Code::Blocks)

what happened to the .obj format?

(1/2) > >>

speedreadersteve:
c++ source file creates a .o in windows 10.  The .exe still works, but the book I'm reading 'Programming Principles and Practice' (the Bjarne one) says that .o is used by Unix, not windows.

So anyway, I'm wondering if either that's changed, or if it's no problem for linking on codeblocks, or... is there a history behind this, and why this still works this way? 

Probably a complex question, or probably not.  Anyway, I thought I'd ask.  Thanks!

Pecan:
CodeBlocks was primarily originated by Linux developers.

It uses the a default GNU gcc compiler toolchain (from Linux), so it outputs object files with extension .o rather than MSVC object extension of .obj.

You can, if you wish, install and use the MSVC compiler with CodeBlocks as the IDE (Integrated Development Environment) in which case you'll get an .obj file.

http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler

cacb:

--- Quote from: Pecan on August 13, 2019, 07:26:12 am ---You can, if you wish, install and use the MSVC compiler with CodeBlocks as the IDE (Integrated Development Environment) in which case you'll get an .obj file.

--- End quote ---

This is correct. I have done that for years and still use the MSVC compiler with Code::Blocks on Windows. The .obj vs. .o is not a question of operating system, but which C++ compiler is being used.

My C::B project files have 4 build targets, 2 for MSVC (MSVC_Debug/MSVC_Release) and 2 for GNU gcc (GCC_Debug/GCC_Release). The reason for using MSVC on windows is that I need to be compatible with external MSVC-built libraries, plus I prefer the MSVC debugger. Still, most of my projects build and run with GCC under linux, under C::B.

Code::Blocks offers a lot of flexibility!

speedreadersteve:
So it appears my programs still work on windows.  Any guess why?

stahta01:
Please the rules for this website!
http://forums.codeblocks.org/index.php/topic,9996.0.html

Navigation

[0] Message Index

[#] Next page

Go to full version