c++ - How to call a function from a header file -
how call function source file header file?
//h.h
extern string pic; class takepic { public: void warpic(); void artpic(); void fatepic(); void painpic(); void nopic(); };
// second part of same header calls function takepic picture;
void picturetype() { if (pic == "war") { picture.warpic(); } else if (pic == "fate") { picture.fatepic(); } else if (pic == "pain") { picture.painpic(); } else if (pic == "art") { picture.artpic(); } else { picture.nopic(); } }
when says linker not working. error linker command failed exit code 1.
what happens if change
void picturetype()
to
inline void picturetype()
you should tell whole error message, , perhaps try searching before asking question.
Comments
Post a Comment