How to include two forms?

im doing this:

in form1:
#include "form2.h"
&&

in form2:
#include "form1.h"
its redefinition error since im including form2 in form 1 .. and then in form 2 im including form 1 and form is including form 2 again and makes an error...

how can i declare both of them without doing redefinition?
- include guard maybe? but i dont know how it is used .. im trying

in form1:
1
2
3
4
#ifndef FORM2_H
#define FORM2_H
#include "form2.h"
#endif 


in form2:
1
2
3
4
#ifndef FORM1_H
#define FORM1_H
#include "form1.h"
#endif 


but it isnt working ://// helppp
Put all your code inside the include guards, not just the #includes.
tried that .. still :
fatal error LNK1169: one or more multiply defined symbols foun
anyone?!!
Take advantage of prototyping. You don't have to include headers to use prototypes.
Why are your include guards named after the file that's being included, as opposed to the file they belong to?
It's typical that you name your include guards after the file that they're guarding against circular / recursive inclusion.

file.h
1
2
3
4
#ifndef _FILE_H_
#define _FILE_H_
/**/
#endif 


As for why you're getting linking errors, there's no way of knowing without looking at some actual code.
Topic archived. No new replies allowed.