Hi everybody,

following problem:

I'm using a struct comparable to this one in my code:
Qt Code:
  1. #ifndef STRUCT_MYPOINT
  2. #define STRUCT_MYPOINT
  3. #include <QDataStream>
  4.  
  5. typedef struct MyPoint {
  6. int x;
  7. int y;
  8. }MyPoint;
  9.  
  10. QDataStream &operator<<(QDataStream &out, const MyPoint &p)
  11. {
  12. out << (qint32)p.x;
  13. out << (qint32)p.y;
  14. return out;
  15. }
  16.  
  17. QDataStream &operator>>(QDataStream &in, MyPoint &p)
  18. {
  19. in >> (qint32)p.x;
  20. in >> (qint32)p.y;
  21. return in;
  22. }
  23. #endif
To copy to clipboard, switch view to plain text mode 
this struct is defined in a seperate *.h file, lets say "mypoint.h"

my code works fine if I compile it with Visual Studio .Net & Qt 4.4.0

now I also try to compile my code under a linux environment using qt 4.4.0 and gcc 4.2.0

now the same code won't compile anymore.
I get a long list of errors messages, with the important ones saying

no match for 'operator>>'
no match for 'operator<<'

searched the net for some kind of solution, but haven't found one.
only thing I learned is that I must add, at least, the following lines to my code:
Qt Code:
  1. friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const MyPoint &);
  2. friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, MyPoint &);
To copy to clipboard, switch view to plain text mode 

added these lines to my struct:

Qt Code:
  1. #ifndef STRUCT_MYPOINT
  2. #define STRUCT_MYPOINT
  3. #include <QDataStream>
  4.  
  5. typedef struct MyPoint {
  6. int x;
  7. int y;
  8. }MyPoint;
  9.  
  10. QDataStream &operator<<(QDataStream &out, const MyPoint &p)
  11. {
  12. out << (qint32)p.x;
  13. out << (qint32)p.y;
  14. return out;
  15. }
  16.  
  17. QDataStream &operator>>(QDataStream &in, MyPoint &p)
  18. {
  19. in >> (qint32)p.x;
  20. in >> (qint32)p.y;
  21. return in;
  22. }
  23. friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const MyPoint &);
  24. friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, MyPoint &);
  25. #endif
To copy to clipboard, switch view to plain text mode 

but the problem remains.

So what am I missing/doing wrong???

greetz
darksaga