The definition is:Originally Posted by manasij7479
Originally Posted by C++03 Clause 2 Paragraph 1 (part)
This is a discussion on Having trouble with llinker and Undefined reference errors within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by manasij7479 What is a translation unit ? The definition is: Originally Posted by C++03 Clause 2 Paragraph ...
The definition is:Originally Posted by manasij7479
Originally Posted by C++03 Clause 2 Paragraph 1 (part)
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
OK.. Suggest me something...
I have multiple independent (*.h + *.cpp) pairs ...They are translation units if I understand the definition.
All of them need to be combined into a single project..
Till now ..I've been # including the headers in the main program...and then giving the compiler the *.cpp files together..
Is there a better way to work with such distinct units ?
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
That's a normal way of working: you have separate source files and include headers where you need them, then finally link the object files generated to form the final product.Originally Posted by manasij7479
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
Normally, all you do is add all the .cpp files to the project list of source files.
The IDE generates a 'makefile' from this, and then make works out the minimum dependencies necessary to keep the executable up to date.
Done well, if you edit only one source file, you only compile that source file and then run the linker to combine all the objects and libraries together.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
What is the difference between an IDE generated makefile and a manually made one ?...Is there some tech *magic* (!) involved so that the former one works better ?
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
That depends on your makefile writing skills, methinksOriginally Posted by manasij7479
![]()
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way