I separted the definition and declaration. Just followed wat u did but main cpp file gives error pointing at #include"filename.h" could u please help me out
OMG! i've been doing my project for 2 days and its not working properly just because i didnt include the header file in main!! thanks a lot this really help me in finishing it =)
if u compile all wat u've jus done will it work? because when i compiled it all i got a compiler error : 8 C:\Dev-Cpp\soldier.cpp expected init-declarator before "strength"
and it high- lighted this part: strength(startstrength),
not sure exactly why you get that error... try to pay more attention to the stuff im teaching and less attention to the actual code being shown. review about how exactly to make the initialization list and do it correctly on your own (not copying from my code)
Many, many thanks for this video tutorial. You are a great teacher!
I get this message when compiling the code of this video: (it is referring to the tutorial.obj of the tutorial.cpp)
error LNK2019: unresolved external symbol "public: int __thiscall Soldier::GetHealth(void)" (?GetHealth@Soldier@@QAEHXZ) referenced in function _main
Another error messages in the same output (referring to the tutorial.exe) is: fatal error LNK1120: 1 unresolved externals
What's wrong?
ExavierLestat 3 months ago
@ExavierLestat did you define Soldier::GetHealth() ? If you didn't, that would explain your error.
MrShyguy0 1 month ago in playlist More videos from antiRTFM
I like your voice; it's very... soothing. :)
FalafelZombie 9 months ago
what if you needed lots of different soldiers but you didn't want to clutter up the main? where is the best place to put them?
pqowieuryt101 1 year ago
I'm using dev c++ compiler
I separted the definition and declaration. Just followed wat u did but main cpp file gives error pointing at #include"filename.h" could u please help me out
Thanks
babuks82 1 year ago
Comment removed
KatsuseChan 1 year ago
Thank you for this video, this cleared up my problem of understanding why you would need a header (I've came from a C# background).
Anyways I'm going to subscribe and watch all the vids in this series.
casgrimes 1 year ago
Is there somewhere i can get these tutorial source files after watching the video because i can;t see all the text in the header file?
master10123 1 year ago
Comment removed
101abob 1 year ago
So header files act as a kind of "bridge" between source files. Cool. Thanks
Nezmundo00 2 years ago
@Nezmundo00
yup, good analogy :)
antiRTFM 1 year ago
VS gets very cranky if you dont include your headers and namespace in your header files.
scooped13 2 years ago
Man! You are God sent. This is by far the best tutorial on the subject. You are awesome at explaining stuff.
I wish you all the best, and thanks a million!
Mickley74 2 years ago
I can't believe Im up to 40. approximately 400 minutes of learning c++
thanks antiRTFM
meomix100 2 years ago
Basically 6 hours and 50 minutes. ^_^
HackedVision 2 years ago
rofl i fail
meomix100 2 years ago
lolz.
HackedVision 2 years ago
God Bless You
MatrixNEO006 2 years ago
@MatrixNEO006 I like to see that any comment about God gets thumbs down, just joking. But seriously, its an interesting fact :)
0121ryanh117 2 years ago
good work antiRTFM i've learnt so much =D. Ty for your time
MoragsPVP 2 years ago 19
OMG! i've been doing my project for 2 days and its not working properly just because i didnt include the header file in main!! thanks a lot this really help me in finishing it =)
crosscourt2006 2 years ago
This has been flagged as spam show
pshh!! wassup ! im a computer programmer! ;]]
jeezcak3 2 years ago
@jeezcak3 no your not.
0121ryanh117 2 years ago
i made a header file called "all.h" and i included everything i need in this file and then include it to every .cpp file hope that helps :)
markyehia 2 years ago 2
This has been flagged as spam show
Legend :D
im semi - n00b now yay
babyaiko 2 years ago
stop spamming, i'm sick of you. :(
MihaiZeu 2 years ago 9
lol the views are 2009
teranos15 2 years ago 2
when i try to run this prog i get linker errors. how do i correct that? i'm using tcc.
3ccentrik 3 years ago
remind me whats tcc?
did you maybe mean gcc?
antiRTFM 3 years ago
turbo c++ compiler.
3ccentrik 3 years ago
you'd need to lookup the documentation on how to correctly setup your environment so that the linker works.
if your on windows i'd strongly recommend you use Microsoft Visual C++, everything is already setup in there
antiRTFM 3 years ago
phew.. this cleared up quite a bit. I compiled last videos code and had a lot of errors even tough i tried it in two compilers.
Sadlez 3 years ago
If you just start a blank project, not any templates you won't have to add the stdafx.h!
dbproguy 3 years ago
if 'at once' you mean like in the same project or same source code file, yes
antiRTFM 3 years ago
you probably switch off "precompiled headers" which i also demonstrate in one of the videos
antiRTFM 3 years ago
if u compile all wat u've jus done will it work? because when i compiled it all i got a compiler error : 8 C:\Dev-Cpp\soldier.cpp expected init-declarator before "strength"
and it high- lighted this part: strength(startstrength),
the one in soldier.cpp
whats it about?
benton202 3 years ago
not sure exactly why you get that error... try to pay more attention to the stuff im teaching and less attention to the actual code being shown. review about how exactly to make the initialization list and do it correctly on your own (not copying from my code)
antiRTFM 3 years ago
great one !
lambda30 3 years ago
Very great tutorial and I can't thank you enough.
Even though I know most of the previous videos(yeah I watched all of the 40 vides! ;) )
This one has taught a lot.
m4design 3 years ago