OpenNI2
OpenNI2 copied to clipboard
master branch does not build
Hi,
the develop
branch works fine, but in master
, there are 3 easy-fix issues:
-
-Werror
with unused typedef
make[1]: Entering directory `/home/niklas/openni/master/OpenNI2/Source/Drivers/PSLink'
g++ -MD -MP -MT "./../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.d ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o" -c -msse3 -Wall -O2 -DNDEBUG -I../../../Include -I../../../ThirdParty/PSCommon/XnLib/Include -I. -IProtocols/XnLinkProto -ILinkProtoLib -fPIC -fvisibility=hidden -Werror -o ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o LinkProtoLib/XnLinkControlEndpoint.cpp
In file included from LinkProtoLib/XnLinkMsgEncoder.h:6:0,
from LinkProtoLib/XnLinkControlEndpoint.h:5,
from LinkProtoLib/XnLinkControlEndpoint.cpp:1:
LinkProtoLib/XnLinkControlEndpoint.cpp: In member function ‘XnStatus xn::LinkControlEndpoint::EnumerateStreams(xnl::Array<XnFwStreamInfo>&)’:
LinkProtoLib/XnLinkProtoUtils.h:18:43: error: typedef ‘compileAssert’ locally defined but not used [-Werror=unused-local-typedefs]
#define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
^
LinkProtoLib/XnLinkControlEndpoint.cpp:1174:3: note: in expansion of macro ‘XN_COMPILER_ASSERT’
XN_COMPILER_ASSERT(sizeof(aStreamInfos[i].creationInfo) >= sizeof(pEnumerateNodesResponse->m_streamInfos[i].m_strCreationInfo));
^
cc1plus: all warnings being treated as errors
- Another
-Werror
with unused typedef
make[1]: Entering directory `/home/niklas/openni/master/OpenNI2/Source/Drivers/PSLink/PSLinkConsole'
g++ -MD -MP -MT "./../../../../Bin/Intermediate/x64-Release/PSLinkConsole/XnLinkControlEndpoint.d ../../../../Bin/Intermediate/x64-Release/PSLinkConsole/XnLinkControlEndpoint.o" -c -msse3 -Wall -O2 -DNDEBUG -I../../../../Include -I../../../../ThirdParty/PSCommon/XnLib/Include -I../ -I../Protocols/XnLinkProto -I../LinkProtoLib -fPIC -fvisibility=hidden -Werror -o ../../../../Bin/Intermediate/x64-Release/PSLinkConsole/XnLinkControlEndpoint.o ../LinkProtoLib/XnLinkControlEndpoint.cpp
In file included from ../LinkProtoLib/XnLinkMsgEncoder.h:6:0,
from ../LinkProtoLib/XnLinkControlEndpoint.h:5,
from ../LinkProtoLib/XnLinkControlEndpoint.cpp:1:
../LinkProtoLib/XnLinkControlEndpoint.cpp: In member function ‘XnStatus xn::LinkControlEndpoint::EnumerateStreams(xnl::Array<XnFwStreamInfo>&)’:
../LinkProtoLib/XnLinkProtoUtils.h:18:43: error: typedef ‘compileAssert’ locally defined but not used [-Werror=unused-local-typedefs]
#define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
^
../LinkProtoLib/XnLinkControlEndpoint.cpp:1174:3: note: in expansion of macro ‘XN_COMPILER_ASSERT’
XN_COMPILER_ASSERT(sizeof(aStreamInfos[i].creationInfo) >= sizeof(pEnumerateNodesResponse->m_streamInfos[i].m_strCreationInfo));
^
cc1plus: all warnings being treated as errors
- Linker error because
-lpthread
is missing
make[1]: Entering directory `/home/niklas/openni/master/OpenNI2/Source/Tools/NiViewer'
g++ -o ../../../Bin/x64-Release/NiViewer ./../../../Bin/Intermediate/x64-Release/NiViewer/Device.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Draw.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Keyboard.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Menu.o ./../../../Bin/Intermediate/x64-Release/NiViewer/MouseInput.o ./../../../Bin/Intermediate/x64-Release/NiViewer/NiViewer.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Capture.o -L../../../ThirdParty/PSCommon/XnLib/Bin/x64-Release -L../../../Bin/x64-Release -lglut -lGL -lOpenNI2 -lXnLib -Wl,-rpath ./
/usr/bin/ld: ../../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxMutex.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Thanks!
I'm building 5b88c95e4f8d19b95713e3c873c7d07e48e5605b on ubuntu 14.04. I use a commandline like make ALLOW_WARNINGS=1 to work around the first two issues, and a patch like
--- OpenNI2-2.2.0.30/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile.old 2014-03-28 19:09:11.572263107 -0700
+++ OpenNI2-2.2.0.30/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile 2014-03-28 19:09:55.600261937 -0700
@@ -95,6 +95,9 @@
OUTPUT_NAME = $(EXE_NAME)
# We want the executables to look for the .so's locally first:
LDFLAGS += -Wl,-rpath ./
+ ifneq ("$(OSTYPE)","Darwin")
+ LDFLAGS += -lpthread
+ endif
OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS)
endif
ifneq "$(SLIB_NAME)" ""
for the second.
Last one is a dup of issue #47
You can see this #46