Click here to Skip to main content
15,885,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I was reading about the difference between .cpp and .h files. It looks like each .cpp file is compiled seperately. Does that mean that the final single exe that I want has multiple exe's inside of it?

GCC, codeblocks, windows, c++11 to c++17.

What I have tried:

I tried to see the result, but not certain how to do that.
Posted
Updated 1-Apr-23 18:32pm

Quote:
I was reading about the difference between .cpp and .h files. It looks like each .cpp file is compiled seperately. Does that mean that the final single exe that I want has multiple exe's inside of it?


No when the various object file are linked they are linked into a single executible.
 
Share this answer
 
Maybe take a look at this. Compiling and Linking - Cprogramming.com[^]
 
Share this answer
 
In short, the compiler generates an .obj file for each .cpp/.h, and then generates a .exe from those .obj files, instead of a "container exe" with some "child exes".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900