Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Zidane

Compiler (VC7) warning

This topic is 5577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok when compiling my windowing library using vc7 i get this warning: c:\MikesStuff\Programming\WindowLibrary\window\CWindowFactory.h(52) : warning C4251: ''WindowLib::CWindowFactory::m_Windows'' : class ''std::vector<_Ty,_Ax>'' needs to have dll-interface to be used by clients of class ''WindowLib::CWindowFactory Ok may sound stupid, but can someone actually tell me what this means, and if it is serious or not. The offending area of code seems to be: (in a header called CWindowFactory.h) class WINDOW_API CWindowFactory { friend class CWindow; public: static CWindowFactory* GetInstance(); WindowResult CreateNewWindow(SWindowOptions* WindowOptions_); WindowResult AssignObserver(IWindowMsgObserver* pUserObserver_); WindowResult CloseAllWindows(); WindowResult CloseWindow(CWindow* pTargetWindow_); int StartMessagePump(); bool GetMessage(); private: static CWindowFactory* m_pInstance; static LRESULT CALLBACK WndProc(HWND hWnd_, UINT uiMessage_, WPARAM pHParam_, LPARAM pLParam_); // THIS LINE HERE *** std::vector m_Windows; // ******************* IWindowMsgObserver* m_pClientObserver; ATOM m_WindowClassHandle; }; any ideas solutions most appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Try std::vector< "type in the vector" > m_Windows;. it might stop the warning. Replace the quote with the type the vector stores.

Share this post


Link to post
Share on other sites
damm forums ! the line actually looks likes this:


std::vector<"CWindow"> m_Windows;

(minus the qoute marks)

Share this post


Link to post
Share on other sites
The compiler is complaining because the STL headers don''t have __declspec(dllexport) specified. However, I''m pretty sure that all the STL stuff is exported, so you can safely ignore the warnings. You might want to put a

#pragma warning(disable: 4251)
...
#pragma warning(enable: 4251)

around the STL references. That way you won''t be annoyed by them, but will still get warnings if you have a similar situation in your own code.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!