![]() |
![]() |
![]()
Post
#1
|
|
![]() Group: Members Posts: 2,342 Joined: 30-July 06 Member No.: 10,575 ![]() |
I'm starting to hopefully code a game for the Z, but I need to put stuff not only in multiple .hpp files but also in .cpp files. Does anybody have a good link for how to do this? My horrible searching skills failed to turn anything up.
Also, is there a good tutorial for using the autotools/makefiles? Those seem to be important to using multiple source files as well. Thanks. |
|
|
![]() |
![]()
Post
#2
|
|
![]() Group: Members Posts: 2,342 Joined: 30-July 06 Member No.: 10,575 ![]() |
Thanks for the quick reply. How do I make function calls to the other .cpp files then? I don't understand how it works if you aren't including them.
I use .hpp instead of .h because editors with syntax highlighting highlight differently for C than they do for C++, which makes it odd to read. With .hpp, they use the C++ highlighting, making it more consistant. |
|
|
![]()
Post
#3
|
|
![]() Group: Members Posts: 2,803 Joined: 21-March 05 From: Sydney, Australia Member No.: 6,686 ![]() |
QUOTE(Capn_Fish @ Aug 20 2007, 10:58 AM) Thanks for the quick reply. How do I make function calls to the other .cpp files then? I don't understand how it works if you aren't including them. I use .hpp instead of .h because editors with syntax highlighting highlight differently for C than they do for C++, which makes it odd to read. With .hpp, they use the C++ highlighting, making it more consistant. you are supposed to have function definitions for each of your methods and include those in header files so that other source files that need to use them can then simply include those headers. hpp files are a newer standard for cpp header files and usually are used to define cpp templates. you can even mix cpp and c objects to some extend by using the extern c definitions... tmake/qmake are for generating QTE / QT makefiles. if you are trying to generate makefiles for QT under pdaXrom you would also be using qmake, but for general c/c++ code, you would use automake to generate the build templates and then run configure and make to actually compile and build. |
|
|
![]()
Post
#4
|
|
![]() Group: Members Posts: 370 Joined: 25-February 04 From: UK Member No.: 2,025 ![]() |
QUOTE(Meanie @ Aug 19 2007, 05:18 PM) hpp files are a newer standard for cpp header files and usually are used to define cpp templates. you can even mix cpp and c objects to some extend by using the extern c definitions... Hi Meanie, Is hpp really a new standard ? I never heard of it. Can you supply a link to where I can find more info ? I always mixed C and C++ in header files with no problems. thanks koan |
|
|
![]()
Post
#5
|
|
![]() Group: Members Posts: 2,803 Joined: 21-March 05 From: Sydney, Australia Member No.: 6,686 ![]() |
QUOTE(koan @ Aug 21 2007, 12:25 PM) QUOTE(Meanie @ Aug 19 2007, 05:18 PM) hpp files are a newer standard for cpp header files and usually are used to define cpp templates. you can even mix cpp and c objects to some extend by using the extern c definitions... Hi Meanie, Is hpp really a new standard ? I never heard of it. Can you supply a link to where I can find more info ? I always mixed C and C++ in header files with no problems. thanks koan http://filext.com/file-extension/HPP well, the hpp standard for c++ headers was introduced after c++ came to which naturally was after the c standard so in effect, the hpp header convention for c++ headers and h for c headers was newer. however, it was not widely adopted and because of non consensus reasons caused by many programmers that still mix and match c and c++ and many people still use .h files for cpp. hpp headers are used for pure c++ code only and since many cpp programs still have elements of c in them and most people were programming in a hybrid c/c++ mode anyway, the result was hpp was not used that much so mainly c++ extensions which are pure c++ will use hpp file extensions. anyway, its just a convention which makes it easier to detect c++ headers. some people also use .hh instead of .hpp so its not really a standard but more like a convention, but let's not fight about wording symantics. hpp is a commonly used standard convention but not an enforced standard... |
|
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 20th April 2018 - 06:21 PM |