It seems like a really stupid idea to have .h files automatically link all .cpp files that include them. You should have to link the files manually. Can anyone tell me if this design is limited to Visual Studio or is it integrated into the C++ language itself?
WARNING TO EVERYONE FOLLOWING ALONG VIDEO BY VIDEO!!
This first time I separated my code into multiple files and as I was following along I got many errors trying to get everything to link it took me a while to figure out how to get it to all work together , once I got it working I moved on to the next video only to find the extra info I needed LOL , P.S. I WISH I HAD KNOWN ABOUT THESE VIDEOS, 5 BOOKS AND 20 TUTORIALS AGO! "AWESOME COLLECTION"
@programmer0115 I was getting extremely frustrated by this as well, and most people who posted saying nothing about any major errors, are obviously not following along and taking notes, as they should be :P
why don't you include the practice files? Are they on your website? I would be able to figure out a whole lot more if I get hands on with the source code, because I know that I"m doing something wrong with organizing the files - I keep getting an error.
as explained in the vids, you include it in its definition (cpp) file and in any other place you'd need to make use of its stuff, be it main.cpp or anywhere else
If you use multiple source/header files do you have to do something different when you distribute your program? Can you still just give them the .exe and it will work? I think that's what you're saying, not certain though. Another great vid :)
you can pretty much distribute your exe as is. technically though youll need to install the MSVC++ Runtime on whatever Windows system you want to run it.
Oh no, i got a compiler error about "function overloading" when i called a method in class which i've declared in a header file, and defined in a cpp source file.
you must make sure the declaration and header of definition match perfectly in the return type, function name, and the amount and types and order of parameters. (parameter names dont make a difference though)
maybe send me a PM with a paste of your different source code files
yup i actually mentioned about this kind of programming in video #2 i think but then i opted to teach in full blown IDEs which makes things a lot easier for noobs instead of needing to learn all the different commands and compiler options to type into the command line
this depends on what compiler IDE your using and on which platform (operating system) you're compiling. You would probably need to make the type of project that suits the OS's windowing application type. So on windows its the Windows application (or whatever its called in your specific IDE) and on other platforms- not sure what it would be called.
Linux refers it to x86-32 and x86-64. However, the meaning really isn't that significant. Unless your OS or processor is picky about running 32 / 64 bit applications, the need to worry about 3D in either is not necessary because both are capable of 3D interaction (although 64 bit tends to be faster). Obviously though, worrying about 3D at this point is moot.
Thanks for the tutorials, btw. I've been RTFM but your videos sure help fill gaps. Also, thank you for standardization, since I use Linux.
Thanks so much.
tshi0404 2 months ago in playlist C++
Comment removed
KatsuseChan 1 year ago
Comment removed
KatsuseChan 1 year ago
It seems like a really stupid idea to have .h files automatically link all .cpp files that include them. You should have to link the files manually. Can anyone tell me if this design is limited to Visual Studio or is it integrated into the C++ language itself?
Aldeni1551 1 year ago
WARNING TO EVERYONE FOLLOWING ALONG VIDEO BY VIDEO!!
This first time I separated my code into multiple files and as I was following along I got many errors trying to get everything to link it took me a while to figure out how to get it to all work together , once I got it working I moved on to the next video only to find the extra info I needed LOL , P.S. I WISH I HAD KNOWN ABOUT THESE VIDEOS, 5 BOOKS AND 20 TUTORIALS AGO! "AWESOME COLLECTION"
programmer0115 1 year ago
@programmer0115 I was getting extremely frustrated by this as well, and most people who posted saying nothing about any major errors, are obviously not following along and taking notes, as they should be :P
KatsuseChan 1 year ago
why don't you include the practice files? Are they on your website? I would be able to figure out a whole lot more if I get hands on with the source code, because I know that I"m doing something wrong with organizing the files - I keep getting an error.
Demyst54 1 year ago
It's good to know about organising / separating the declarations and definitions! Awesome.
moidage 2 years ago
you made me lol @ 0:45 . I was like noooooo then i heard the rest and was like phew.
jasonxe1 2 years ago
I hate when I take a break for about a week. then i feel like ive forgotten so much
meomix100 2 years ago 2
Your program is DOOMED! lol
rgrinie 2 years ago
yeah burgert, this is very important!
once you make bigger programs it will get very very messy.
for example when you start socket programming your codes gonna get long
HordeAreMyFatCousins 2 years ago
"Hide away the dirty details"
it made me lol.
AlliedSamurais 2 years ago 10
is this really that important can i just put my classes in one header file and be done with
burgert10 2 years ago 2
@burgert10
u do that with a big file w/ 10000+ lines, and you will mess up half ur variables near the end of the file. Then, debugging.... omg, hell.
N0wShutUp 1 year ago
Bravo,, Crystal Clear Explanation!!!!
Better than my damn stupid TextBook
paudeluttam 2 years ago 12
do you have to add the "solider.h" to the main? or do you just add it to the cpp file?
element1988 2 years ago
as explained in the vids, you include it in its definition (cpp) file and in any other place you'd need to make use of its stuff, be it main.cpp or anywhere else
antiRTFM 2 years ago
This has been flagged as spam show
Why!?? ;[
1>z:\omm15227\moms\wp\visual studio 2008\projects\tutorial\tutorial\tutorial.cpp(9) : error C2065: 'Soldier' : undeclared identifier
1>z:\omm15227\moms\wp\visual studio 2008\projects\tutorial\tutorial\tutorial.cpp(9) : error C2146: syntax error : missing ';' before identifier 'john'
jeezcak3 2 years ago
please join the forums where you can paste all your code and errors
antiRTFM 2 years ago 2
just what I was looking for thanksa lot :)
mjd550 2 years ago
Do you cut your Video???
8:02 - 8:04
jookerxxx500 2 years ago
yes :)
antiRTFM 2 years ago
Legend :D
i've been Absolute spoonfed vodka
babyaiko 2 years ago 2
If you use multiple source/header files do you have to do something different when you distribute your program? Can you still just give them the .exe and it will work? I think that's what you're saying, not certain though. Another great vid :)
funkyewan 2 years ago
you can pretty much distribute your exe as is. technically though youll need to install the MSVC++ Runtime on whatever Windows system you want to run it.
antiRTFM 2 years ago
ABSOLUTELY AWESOME!
dsl9 3 years ago
Oh no, i got a compiler error about "function overloading" when i called a method in class which i've declared in a header file, and defined in a cpp source file.
So how can i solve this error??
choothohong 3 years ago
you must make sure the declaration and header of definition match perfectly in the return type, function name, and the amount and types and order of parameters. (parameter names dont make a difference though)
maybe send me a PM with a paste of your different source code files
antiRTFM 3 years ago
Nevermind, i found out my mistake..I forgot to add parenthesis to the function called...
By the way, im very expecting to your new videos
choothohong 3 years ago
Another note, since most Linux users use the command shell, usually we just use the built-in gcc compiler and a simple text editor.
ubuntudoc 3 years ago
yup i actually mentioned about this kind of programming in video #2 i think but then i opted to teach in full blown IDEs which makes things a lot easier for noobs instead of needing to learn all the different commands and compiler options to type into the command line
antiRTFM 3 years ago
Will you put up videos once about doing it like so when we get to a more advance level in programming?
Sadlez 3 years ago
excellent tutorial! Thank you so much for this!
BaronSenf 3 years ago
will we be using different parts of the c++ compiler besides win32 ?? which part does 3D programing?
benton202 3 years ago
this depends on what compiler IDE your using and on which platform (operating system) you're compiling. You would probably need to make the type of project that suits the OS's windowing application type. So on windows its the Windows application (or whatever its called in your specific IDE) and on other platforms- not sure what it would be called.
antiRTFM 3 years ago
Linux refers it to x86-32 and x86-64. However, the meaning really isn't that significant. Unless your OS or processor is picky about running 32 / 64 bit applications, the need to worry about 3D in either is not necessary because both are capable of 3D interaction (although 64 bit tends to be faster). Obviously though, worrying about 3D at this point is moot.
Thanks for the tutorials, btw. I've been RTFM but your videos sure help fill gaps. Also, thank you for standardization, since I use Linux.
ubuntudoc 3 years ago