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

Master branch failed to build test files on Ubuntu 18.04 #220

Closed
mli0603 opened this issue Dec 11, 2019 · 2 comments
Closed

Master branch failed to build test files on Ubuntu 18.04 #220

mli0603 opened this issue Dec 11, 2019 · 2 comments

Comments

@mli0603
Copy link

mli0603 commented Dec 11, 2019

Using the command

cmake -DBUILD_SHARED_LIBS:BOOL=ON ../OpenIGTLink
make

will fail the build due to error

~/igtl/OpenIGTLink/Testing/igtlCommandMessageTest.cxx:95:3: error: ‘EXPECT_NE’ was not declared in this scope
   EXPECT_NE(messageHeader->crc, crc); // should not be equal as the content changed
   ^~~~~~~~~
~/igtl/OpenIGTLink/Testing/igtlCommandMessageTest.cxx:95:3: note: suggested alternative: ‘EXPECT_LT’
   EXPECT_NE(messageHeader->crc, crc); // should not be equal as the content changed
   ^~~~~~~~~
   EXPECT_LT
~/igtl/OpenIGTLink/Testing/igtlCommandMessageTest.cxx: In member function ‘virtual void CommandMessageTest_UnpackFormatVersion2_Test::Run()’:
~/igtl/OpenIGTLink/Testing/igtlCommandMessageTest.cxx:186:3: error: ‘EXPECT_NE’ was not declared in this scope
   EXPECT_NE(messageHeader->crc, crc); // should not be equal as the content changed
   ^~~~~~~~~
~/igtl/OpenIGTLink/Testing/igtlCommandMessageTest.cxx:186:3: note: suggested alternative: ‘EXPECT_LT’
   EXPECT_NE(messageHeader->crc, crc); // should not be equal as the content changed
   ^~~~~~~~~
   EXPECT_LT

This indicates there is something imcompatible with the current gtest. I had to turn off the flag BUILD_TESTING to compile the project.

I tried to turn off the flag BUILD_SHARED_LIBS, and the build proceeds without error. What is the issue exactly?

@mli0603 mli0603 changed the title Master branch test build failed on Ubuntu 18.04 Master branch failed to build test files on Ubuntu 18.04 Dec 11, 2019
@leochan2009
Copy link
Contributor

leochan2009 commented Dec 11, 2019

HI,

shared build of google test library tend to fail under windows environment. when shared_build is turn on, we use a local file igtlTestConfig.h.in for testing marcos. As for the commandmessage test, EXPECT_NE is not defined in the igtlTestConfig.h.in.
you can see this issue for more details:
#122

@leochan2009
Copy link
Contributor

The fix should work.

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

2 participants