CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Jul 2002
    Posts
    788

    Help in operator << >> overloading in Library

    Code:
    class VAR_EXPORT VAR
    {
    public:
    
    
    
    };
    VAR_EXPORT QDataStream &operator>>(QDataStream &p_stream, QSharedPointer<Data>& p_data)
    	{
    
    	.....................
    	}
      VAR_EXPORT QDataStream & operator<<(QDataStream &p_stream, const Data & p_data)
    	{
    		..........
    	}
    	
      VAR_EXPORT QDataStream &operator<<(QDataStream &p_stream, QSharedPointer<Data> p_data)
    	{
    		return p_stream << *p_data;
    	}
    Above compile and build ok. But when i build another library that use the above, i was shown with all errors complaining operator << and >> definition of dllimport finction not allowed

    error C2491: 'operator >>' : definition of dllimport function not allowed
    error C2491: 'operator <<' : definition of dllimport function not allowed
    Last edited by mce; August 1st, 2014 at 03:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured