C4275 warnings under windows

112 views
Skip to first unread message

Anatoly Baksheev

unread,
May 6, 2011, 4:33:36 PM5/6/11
to Google C++ Testing Framework

How to remove the warnings below that appear when I compile gtest as
dll?

Its annoying to see 10 gtest warnings for each of my test executable
(total warnings > 300 ).


Warning 13 warning C4251: 'testing::TestResult::test_part_results_' :
class 'std::vector<_Ty>' needs to have dll-interface to be used by
clients of class 'testing::TestResult'

Warning 14 warning C4251: 'testing::TestResult::test_properties_' :
class 'std::vector<_Ty>' needs to have dll-interface to be used by
clients of class 'testing::TestResult'

Warning 15 warning C4251: 'testing::TestCase::test_info_list_' : class
'std::vector<_Ty>' needs to have dll-interface to be used by clients
of class 'testing::TestCase'

Warning 16 warning C4251: 'testing::TestCase::test_indices_' : class
'std::vector<_Ty>' needs to have dll-interface to be used by clients
of class 'testing::TestCase'

Kirk Woodhouse

unread,
May 6, 2011, 9:43:13 PM5/6/11
to Google C++ Testing Framework

Anatoly:
Try,

#include . . .
#include . . .
#pragma warning( push )
#pragma warning( disable : 4251)
. . .
. . . Your test class definition here
. . .
#pragma warning( pop ) // 4251

Kirk

On May 6, 4:33 pm, Anatoly Baksheev <anatoly.baksh...@itseez.com>
wrote:
Reply all
Reply to author
Forward
0 new messages