PDA

View Full Version : How can build my dll using something like QtGui/Qwidget



tonnot
11th February 2011, 13:50
I explain what I want.
I have a superclass with 3 inner classes into it.
ok, i'd want to write includes to use only one of these 3 inner classes
I dont know how to do it.
I'd want to write #include <MYCLASS/MYINNERCLASS1>
But besides.... I have .h files, so I will not can to write :
#include "MYCLASS/MYINNERCLASS1.h" becasue it does not exist.

Any help ?
Thanks

tonnot
11th February 2011, 13:58
I have my dll with a class that has 3 inner classes.
At level code I can write SUPERCLASS::INNERCLASS.method
(that is to said, QT Creator can understand my code)
But, later it does not compile. I have undefined reference errors....

undefined reference to `W_inpout::Ascii::Ascii()'
undefined reference to `W_inpout::Ascii::openread(std::string)'
etc (all the public methods of my class Ascii)

My dll is builded correctly (I think... because there is no errors. )

Any help ?
Thanks

high_flyer
11th February 2011, 14:46
What is the reason you have to define the other classes in the main class?
It only makes sense if the inner classes are meant only for inner use - in which case you don't need it outside, the way you are using it.
Put the classes outside, and export them as you did the main class.

tonnot
11th February 2011, 18:09
I want to do this because my work is best organized to myself.
It is clear that I could write 4 single classes, but in this way I forced myself to create the class instances properly
(that is to say if I want to create a specific class from a especific theme for me is very suitable see me forced to write Myclass::my_interior_class.
Maybe you can think that it is not neccesary but I'd want to try.
Is there a solution?
Thanks

wysota
11th February 2011, 18:17
I explain what I want.
I have a superclass with 3 inner classes into it.
ok, i'd want to write includes to use only one of these 3 inner classes
I dont know how to do it.
I'd want to write #include <MYCLASS/MYINNERCLASS1>
But besides.... I have .h files, so I will not can to write :
#include "MYCLASS/MYINNERCLASS1.h" becasue it does not exist.

If you want to be able to write "#include <x/y.h>" then create directory "x" and put the file "y.h" in it.

tonnot
11th February 2011, 19:43
Thanks wy.
But how to do the same as QT, that is to say, without .h extension? It is only curiosity.

And... (the two posts are merged) can you give me some help with "How to build dll with a class who has inner clasess" (the second post ..)
Thanks and good week end.

wysota
11th February 2011, 23:26
It is exactly the same. Just look at Qt source tree. It has a file named say... "QFile" which just says "#include <qfile.h>".

I'm not going to answer the other question, I don't understand what your problem is. You are obviously missing some method implementation. This is strictly a C++ related question and I'm growing tired of telling you to learn C++ properly. If you don't understand some C++ concept then just don't use it. Sorry, it may be blunt but it is true.