2017-02-09 2 views
1

Я пытаюсь скомпилировать Исходный код NFIQ 2.0, следуя official guide. На последнем этапе сборки я получаю следующую ошибку.CLOCKS_PER_SEC, отсутствующий двоичный оператор перед токеном ... [NFIQ 2.0]

FRFXLLCreateLibraryContext.cpp:72:5: error: missing binary operator before token "1000000" 
#if CLOCKS_PER_SEC == 1000 
    ^
<builtin>: recipe for target 'FRFXLLCreateLibraryContext.o' failed 

Вот информация о GCC версии настоящего

gcc -v 
Using built-in specs. 
COLLECT_GCC=gcc 
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper 
Target: x86_64-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 
Thread model: posix 
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 

и здесь является информация убунту версия

uname -r 
4.4.0-36-generic 

Что является причиной проблемы, и может ли она быть решена используя другой компилятор? Вот полный лог сборки подпиточной команды

make 
make -C ../libFRFXLL 
make[1]: Entering directory '/home/tutoivon/nfiq2/NFIQ2/libFRFXLL' 
make -C src/libFRFXLL 
make[2]: Entering directory '/home/tutoivon/nfiq2/NFIQ2/libFRFXLL/src/libFRFXLL' 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'FRFXLLCreateFeatureSetInPlaceFromRaw.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLCreateFeatureSetInPlaceFromRaw.o FRFXLLCreateFeatureSetInPlaceFromRaw.cpp 
ar rv ../../lib/libFRFXLL.a FRFXLLCreateFeatureSetInPlaceFromRaw.o 
r - FRFXLLCreateFeatureSetInPlaceFromRaw.o 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'FRFXLLCreateFeatureSetInPlaceFromRaw.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLCreateContext.o FRFXLLCreateContext.cpp 
ar rv ../../lib/libFRFXLL.a FRFXLLCreateContext.o 
r - FRFXLLCreateContext.o 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLCreateFeatureSetInPlace.o FRFXLLCreateFeatureSetInPlace.cpp 
ar rv ../../lib/libFRFXLL.a FRFXLLCreateFeatureSetInPlace.o 
r - FRFXLLCreateFeatureSetInPlace.o 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLGetLibraryVersion.o FRFXLLGetLibraryVersion.cpp 
ar rv ../../lib/libFRFXLL.a FRFXLLGetLibraryVersion.o 
r - FRFXLLGetLibraryVersion.o 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'FRFXLLExport.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLExport.o FRFXLLExport.cpp 
ar rv ../../lib/libFRFXLL.a FRFXLLExport.o 
r - FRFXLLExport.o 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'FRFXLLExport.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLCreateFeatureSet.o FRFXLLCreateFeatureSet.cpp 
ar rv ../../lib/libFRFXLL.a FRFXLLCreateFeatureSet.o 
r - FRFXLLCreateFeatureSet.o 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLDuplicateHandle.o FRFXLLDuplicateHandle.cpp 
ar rv ../../lib/libFRFXLL.a FRFXLLDuplicateHandle.o 
r - FRFXLLDuplicateHandle.o 
make[2]: Warning: Archive '../../lib/libFRFXLL.a' seems to have been created in deterministic mode. 'S/LC_MESSAGES/make.mo' will always be updated. Please consider passing the U flag to ar to avoid the problem. 
g++ -O2 -I../algorithm -I../../include -I../../src/include -I../../../ExternalDependencies/STL/STLport-5.2.1/stlport -fno-exceptions -fno-rtti -fno-stack-protector -fPIC -DFRFXLL_MAJOR=5 -DFRFXLL_MINOR=2 -DFRFXLL_REVISION=0 -DFRFXLL_BUILD=0 -c -o FRFXLLCreateLibraryContext.o FRFXLLCreateLibraryContext.cpp 
In file included from /usr/include/time.h:41:0, 
       from FRFXLLCreateLibraryContext.cpp:35: 
FRFXLLCreateLibraryContext.cpp:72:5: error: missing binary operator before token "1000000" 
#if CLOCKS_PER_SEC == 1000 
    ^
<builtin>: recipe for target 'FRFXLLCreateLibraryContext.o' failed 
make[2]: *** [FRFXLLCreateLibraryContext.o] Error 1 
rm FRFXLLCreateContext.o FRFXLLCreateFeatureSetInPlaceFromRaw.o FRFXLLDuplicateHandle.o FRFXLLCreateFeatureSet.o FRFXLLGetLibraryVersion.o FRFXLLCreateFeatureSetInPlace.o FRFXLLExport.o 
make[2]: Leaving directory '/home/tutoivon/nfiq2/NFIQ2/libFRFXLL/src/libFRFXLL' 
Makefile:50: recipe for target 'src/libFRFXLL' failed 
make[1]: *** [src/libFRFXLL] Error 2 
make[1]: Leaving directory '/home/tutoivon/nfiq2/NFIQ2/libFRFXLL' 
Makefile:7: recipe for target '../libFRFXLL' failed 
make: *** [../libFRFXLL] Error 2 
+0

Присоединяйтесь ко мне в http://chat.stackoverflow.com/rooms/135255/room-for-nfiq-debugging, если хотите –

+0

Только что это заметил. Похоже, это программное обеспечение не проверено. – user1741137

ответ

3

Библиотека NFIQ есть ошибка здесь.

Предполагается, что CLOCKS_PER_SEC является константой макроса, которая может использоваться в директивах препроцессора, таких как #if, но это не так! It expands, in an implementation-defined way, to some expression & hellip; и в GCC 6.3 по крайней мере (и, видимо, ваша версия тоже), что выражение ((clock_t)1000000). This expression will not work in a preprocessor directive.

Возможно, авторы NFIQ протестировали его только в Visual Studio и, возможно, Visual Studio , так получилось, чтобы развернуть этот макрос в базовый литерал. Или, может быть, они вообще не испытывали.

К сожалению, для этого нет легкого решения. Им придется прекратить использование CLOCKS_PER_SEC в директиве препроцессора вообще, но могут ли они легко достичь того же самого с фактическим кодом на C++, которого я не знаю. Определенно один поднять с авторами.

Смежные вопросы