I have the following enum class:
enum class Message : qint8 {INFO = 0, WARNING = 1, NON_FATAL_ERROR = 2, FATAL_ERROR = 3, DEBUG_INFO = 4};
and when I run the following code with Google Test (checked out from SVN):
EXPECT_NO_THROW(
for(qint32 i = 0; i < 10; ++i)
logger->onIncomingMessage(mapper::Message::INFO, "Testing logging system")
);
The signature of the onIncomingMessage function is:
void onIncomingMessage(const mapper::Message &type, const QString &report);
Visual Studio 2012 shows the following exceptions:
Error 1 error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > testing::FLAGS_gtest_death_test_style" (?FLAGS_gtest_death_test_style@testing@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) C:\Users\Michele\Projects\occupancymapper\build\Modules\Core\test_logger.obj
3 IntelliSense: enum "mapper::Message" has no member "INFO" c:\Users\Michele\Projects\occupancymapper\Modules\Core\test\test_logger.cpp 21
4 IntelliSense: enum "mapper::Message" has no member "NON_FATAL_ERROR" c:\Users\Michele\Projects\occupancymapper\Modules\Core\test\test_logger.cpp 30
5 IntelliSense: enum "mapper::Message" has no member "DEBUG_INFO" c:\Users\Michele\Projects\occupancymapper\Modules\Core\test\test_logger.cpp 40
6 IntelliSense: enum "mapper::Message" has no member "FATAL_ERROR" c:\Users\Michele\Projects\occupancymapper\Modules\Core\test\test_logger.cpp 50
Error 2 error LNK1120: 1 unresolved externals C:\Users\Michele\Projects\occupancymapper\build\Modules\Core\Debug\logger.exe 1
Without GoogleTests, the code in my class works fine, but when using GoogleTest, it doesn't. Under Linux, it works perfectly.
I've already applied the VARIADIC_MAX value (set to 10), as suggested here in a similar stackoverflow question, but it doesn't work. What I'm doing wrong?