I got serious problems with Visual c++ and including files.

Dec 5, 2011 at 1:54pm
Hello.

Im programming a Minesweeper (final project of a programming & algorithm in college), this is my first program using visual c++ so we can say im new on this.

I have 3 Forms and 1 header. If I compile each form separated with the header everything is alright but the problem comes when I try to compile the whole project. My 3 forms are Registro.h, Logeo.h & Juego.h and the header that contains the class is FuncionesInternas.h.

I need to include FuncionesInternas in all of the forms. Logeo needs to instance an object of Registro because I have to call Registro if the user isnt registered but at the same time Logeo needs to include FuncionesInternas because all my functions are there, all is fine at this point. If I try to include FuncionesInternas in Registro the program crashes saying that It couldn't instance an object type Registro in Logeo, but if I delete the #include "FuncionesInternas.h" in registro the program compiles very well.

All the forms and the header are in the same namespace.

Any ideas?

Sorry for my bad english, It isn't my native languaje.
Dec 5, 2011 at 3:06pm
Is this an unmanaged C++ project, or is it a C++/CLI project (.net)?
Dec 5, 2011 at 4:19pm
Well, Im developing it my self. I think is a unmanaged C++ project.
Dec 5, 2011 at 4:25pm
Spanish?
Dec 5, 2011 at 4:34pm
You 'think' it is an unmanaged project ? In programming thinking is not enough, you must be sure on what are you doing.

When you say world like 'forms' is most likely an managed program, which is only available as Microsoft propietary language and you choose this most likely being attracted by the visual designer, I am right ? Most beginners do this ...
Dec 5, 2011 at 4:49pm
Sorry, I hadnt investigated about managed and unmanaged code, being honest I had no idea about what it really means.

I wrote FuncionesInternas.h in codeblocks so it has unmanaged code. All the forms were created using the designer of Visual Studio 2010, so It is a C++/CLI project.

And webJose I dont know if you are asking but yes, Spanish is my native languaje.
Last edited on Dec 5, 2011 at 4:50pm
Dec 5, 2011 at 4:52pm
I see. Yes, I was asking in case it would be easier for you to understand further explanations. However, I don't know C++/CLI and cannot assist you further. :-(
Dec 6, 2011 at 5:31am
Well, I had to restructure my code because all were wrong, I didn't get the topic of the thread but I achieved what I wanted. Thanks evrybody for helping.
Topic archived. No new replies allowed.