Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress msvc warning : 4275 non dll-interface class 'x' used as base for dll-interface class 'y' #860

Closed
jmecosta opened this issue Aug 29, 2016 · 9 comments

Comments

@jmecosta
Copy link

Hi

I am getting some warnings as errors as below.

1>d:\prod\structures\packages\gtestmock.1.8.0-alpha003\build\native\include\googletest\gtest/internal/gtest-internal.h(148): error C2220: warning treated as error - no 'object' file generated (test\tool_read_line_test.cpp)
1>d:\prod\structures\packages\gtestmock.1.8.0-alpha003\build\native\include\googletest\gtest/internal/gtest-internal.h(148): warning C4275: non dll-interface class 'std::runtime_error' used as base for dll-interface class 'testing::internal::GoogleTestFailureException' (test\tool_read_line_test.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdexcept(166) : see declaration of 'std::runtime_error'
1> d:\prod\structures\packages\gtestmock.1.8.0-alpha003\build\native\include\googletest\gtest/internal/gtest-internal.h(148) : see declaration of 'testing::internal::GoogleTestFailureException'

This is for a shared dll with visual studio 2013, with runtime dll MultiThreadedDLL. Is there some flag i need to pass to Cmake now to cmake that will handle this.

Thanks in advance.

br

jorge costa

@KindDragon
Copy link
Contributor

Changes about std::runtime_error was in 1.70 1b89db9

What gtest version you use before?

@jmecosta
Copy link
Author

It was 1.7.0. But from the old repository. how is this controlled anyhow

On Mon, 29 Aug 2016 19:11 Arkady Shapkin, notifications@github.com wrote:

Changes about std::runtime_error was in 1.70 1b89db9
1b89db9

What gtest version you use before?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#860 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_jyOUBOi1OwtLm3TDPly5DEhn0G3aIks5qkwSogaJpZM4JvoAL
.

@jmecosta
Copy link
Author

got another one also:

e:\buildagent1\work\9dafcc015c350b6a\packages\gtestmock.1.8.0-alpha004\build\native\include\googletest\gtest/gtest-message.h(224, 0): error C2220: warning treated as error - no 'object' file generated (test\rm_change_detection_utilities_test.cpp)
[19:16:28][CL] e:\buildagent1\work\9dafcc015c350b6a\packages\gtestmock.1.8.0-alpha004\build\native\include\googletest\gtest/gtest-message.h(224, 0): warning C4251: 'testing::Message::ss_' : class 'testing::internal::scoped_ptrstd::stringstream' needs to have dll-interface to be used by clients of class 'testing::Message' (test\rm_change_detection_utilities_test.cpp)
[19:16:29][CL] e:\buildagent1\work\9dafcc015c350b6a\packages\gtestmock.1.8.0-alpha004\build\native\include\googletest\gtest/internal/gtest-filepath.h(200, 0): warning C4251: 'testing::internal::FilePath::pathname_' : class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'testing::internal::FilePath' (test\rm_change_detection_utilities_test.cpp)
[19:16:29][CL] e:\buildagent1\work\9dafcc015c350b6a\packages\gtestmock.1.8.0-alpha004\build\native\include\googletest\gtest/internal/gtest-internal.h(589, 0): warning C4251: 'testing::internal::TypedTestCasePState::registered_tests_' : class 'std::mapstd::string,testing::internal::CodeLocation,std::less<_Kty,std::allocator<std::pair<const _Kty,_Ty>>>' needs to have dll-interface to be used by clients of class 'testing::internal::TypedTestCasePState'

seems not related with 1b89db9?

@jmecosta
Copy link
Author

jmecosta commented Aug 29, 2016

ok, so actually we force the warning to go away in 1.7.0 already.

image

But i am not sure what is the affect of this. and i would like not to be touching the gtest source, since we have configured as submoduled. Is there a more elegant way of handling this.

thanks

@jmecosta
Copy link
Author

after putting back the pragmas disable 1.8.0 is compiling and running without any issues. thanks for the help. if no one has any idea. this can be closed

@KindDragon
Copy link
Contributor

KindDragon commented Aug 30, 2016

Please rename issue than. PR #862 should fix your issue

@jmecosta jmecosta changed the title some regression in 1.80 - non dll-interface class 'std::runtime_error' used as base for dll-interface class 'testing::internal::GoogleTestFailureException' suppress msvc warning : 4275 non dll-interface class 'x' used as base for dll-interface class 'y' Aug 30, 2016
@jmecosta
Copy link
Author

handled by #862

@jmecosta
Copy link
Author

@KindDragon thanks for the help. I will reopen this if find anything else with #862

@KindDragon
Copy link
Contributor

It is better to close this issue when someone of the main developers merge PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants