Getting error when I make libgd-2.2.3 in terminal - Fatal error: too many errors emitted, stopping now [-ferror-limit=] - image-processing

I keep getting this error when I type make libgd-2.2.3 in the Mac terminal:
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [gd_tiff.lo] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
The different errors look like this:
d_tiff.c:678:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 planar;
Does anyone know what this means and what I can do about it?
I also get errors like this:
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED attribute((deprecated))
but most refer to uint16 being depcrecatred.
I'm not super experienced in Mac terminal work or image processing, so any help would be much appreciated.
Here's the entire error message:
Making all in src
/Library/Developer/CommandLineTools/usr/bin/make all-am
depbase=`echo gd_tiff.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/opt/homebrew/Cellar/libpng/1.6.38/include/libpng16 -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/fontconfig/2.14.1/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/libtiff/4.4.0_1/include -Werror -g -O2 -fvisibility=hidden -Wall -MT gd_tiff.lo -MD -MP -MF $depbase.Tpo -c -o gd_tiff.lo gd_tiff.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/opt/homebrew/Cellar/libpng/1.6.38/include/libpng16 -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/fontconfig/2.14.1/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/libtiff/4.4.0_1/include -Werror -g -O2 -fvisibility=hidden -Wall -MT gd_tiff.lo -MD -MP -MF .deps/gd_tiff.Tpo -c gd_tiff.c -fno-common -DPIC -o .libs/gd_tiff.o
gd_tiff.c:235:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 extraSamples[1];
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:236:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 *colorMapRed = NULL;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:237:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 *colorMapGreen = NULL;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:238:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 *colorMapBlue = NULL;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:290:20: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
colorMapRed = (uint16 *) gdMalloc(3 * (1 << bitsPerSample));
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:295:20: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
colorMapGreen = (uint16 *) gdMalloc(3 * (1 << bitsPerSample));
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:301:20: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
colorMapBlue = (uint16 *) gdMalloc(3 * (1 << bitsPerSample));
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:446:1: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 *r, *g, *b;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:458:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 *redcmap, *greencmap, *bluecmap;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:459:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 bps;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:471:3: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 min_sample_val, max_sample_val;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:513:4: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 photometric,
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:545:27: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 photometric,
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:632:58: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
static int createFromTiffTiles(TIFF *tif, gdImagePtr im, uint16 bps, uint16 photometric,
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:632:70: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
static int createFromTiffTiles(TIFF *tif, gdImagePtr im, uint16 bps, uint16 photometric,
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:635:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 planar;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:675:58: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
static int createFromTiffLines(TIFF *tif, gdImagePtr im, uint16 bps, uint16 photometric,
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:675:70: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
static int createFromTiffLines(TIFF *tif, gdImagePtr im, uint16 bps, uint16 photometric,
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
gd_tiff.c:678:2: error: 'uint16' is deprecated [-Werror,-Wdeprecated-declarations]
uint16 planar;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:81:45: note: 'uint16' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
^
/opt/homebrew/Cellar/libtiff/4.4.0_1/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [gd_tiff.lo] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

Related

Can't find erf, erff, etc. compiling under 10.2

I try to compile C++ Mathematical Expression Library (http://www.partow.net/programming/exprtk/index.html) by Arash Parto. Unfort. I do not succeed using 10.2. erf, erff, etc. are not found.
File try to compile:
#pragma hdrstop
#pragma argsused
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR;
#define _tmain main
#endif
#include <stdio.h>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include "exprtk.hpp"
#ifdef exprtk_test_float32_type
typedef float numeric_type;
#else
typedef double numeric_type;
#endif
some defs...
int _tmain(int argc, _TCHAR* argv[])
{
#define perform_test(Type,Number)
int result = 0;
perform_test(numeric_type,00)
#undef perform_test
return result;
}
=======================================
Error log:
Project "D:_Entwicklung.KEL\exprtk_new\Project2.cbproj" (Build target(s)):
Target CreateProjectDirectories:
Creating directory ".\Win32\Debug".
Compiling C++ files...
Target MakeObjs:
Target TCCompile:
C:\Program Files (x86)\JomiTech\TwineCompile\mtbcc32.exe -ide102 -priority0 -files="D:_Entwicklung.KEL\exprtk_new\twfiles.###"
JomiTech TwineCompile 4.5 - Copyright JomiTech 2016. All Rights Reserved.
Compiling 1 files...
Embarcadero C++ 7.30 for Win32 Copyright (c) 1993-2017 Embarcadero Technologies, Inc.
d:_Entwicklung.KEL\exprtk_new\File2.cpp
File2.cpp: (0) 0 of 0
File2.cpp: (0) 368546 of 368546
d:_Entwicklung.KEL\exprtk_new\exprtk.hpp(1200,49): C++ error E2268: Call to undefined function 'erff'
After Remy Lebau's advice I tried the following
#RemyLebeau: Thanks for your advice. However I feel so useless.....
I tried (of course no **):
**using namespace std;**
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || !defined(_MSC_VER)
#define exprtk_define_erf(TT,impl) \
inline TT erf_impl(TT v) { return impl(v); } \
exprtk_define_erf( float,::erff)
exprtk_define_erf( double,::erf )
exprtk_define_erf(long double,::erfl)
#undef exprtk_define_erf
#endif
==> [bcc32c Error] exprtk.hpp(1199): no member named 'erff' in the global namespace
Then I tried:
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || !defined(_MSC_VER)
#define exprtk_define_erf(TT,impl) \
inline TT erf_impl(TT v) { return impl(v); } \
exprtk_define_erf( float,**std**::erff)
exprtk_define_erf( double,**std**::erf )
exprtk_define_erf(long double,**std**::erfl)
#undef exprtk_define_erf
#endif
==> [bcc32c Error] exprtk.hpp(1198): no member named 'erff' in namespace 'std'
New file2.cpp
#pragma hdrstop
#pragma argsused
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR;
#define _tmain main
#endif
using namespace std;
#include "exprtk.hpp"
template <typename T>
void trig_function()
{
typedef exprtk::symbol_table<T> symbol_table_t;
typedef exprtk::expression<T> expression_t;
typedef exprtk::parser<T> parser_t;
//
const std::string expression_string =
"clamp(-1.0,sin(2 * pi * x) + cos(x / 2 * pi),+1.0)";
T x;
symbol_table_t symbol_table;
symbol_table.add_variable("x",x);
symbol_table.add_constants();
expression_t expression;
expression.register_symbol_table(symbol_table);
parser_t parser;
parser.compile(expression_string,expression);
//
for (x = T(-5); x <= T(+5); x += T(0.001))
{
const T y = expression.value();
printf("%19.15f\t%19.15f\n", x, y);
}
}
int _tmain(int argc, _TCHAR* argv[])
{
trig_function<double>();
int result = 0;
return result;
}
After modifiying in #include "exprtk.hpp":
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || !defined(_MSC_VER)
#define exprtk_define_erf(TT,impl) \
inline TT erf_impl(TT v) { return impl(v); } \
// exprtk_define_erf( float,::erff)
exprtk_define_erf( double,::erf )
// exprtk_define_erf(long double,::erfl)
#undef exprtk_define_erf
#endif
I get now:
[ilink32 Error] Fatal: Exceeded memory limit for block Publics in module File2.cpp

How to detect all buffer access by using Clang Static Checker

My target: detect all buffer access in C/C++ by using clang static checker.
My idea: use CheckPosition to get all memory read/write and then filter unrelated items.
My problem: However, I got stuck when I try to filter something like "int i = 1" "i++".
My solution: One way to filter this is to check whether the variable is pointer type or not by using isPointerType().
My question: But I need to get QualType first. The question is how? Or, do I have other ways to achieve my target???
My Clang Checker Code is as below:
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerRegistry.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "llvm-3.4/llvm/Support/raw_ostream.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
using namespace clang;
using namespace ento;
namespace {
class BufferAccessChecker : public Checker<check :: Location> {
//mutable std::unique_ptr<BuiltinBug> BT_access;
mutable std::unique_ptr<BugType> bugType;
public:
BufferAccessChecker(void) {
this->bugType.reset(new BugType("buffer access", "chaz analyzer"));
}
void checkLocation(SVal location, bool isLoad, const Stmt* S, CheckerContext &C) const;
};
}
void BufferAccessChecker::checkLocation(SVal location, bool isLoad, const Stmt* S, CheckerContext &C) const {
if (location.isUndef() || !location.getAs<Loc>())
return;
const MemRegion *R = location.getAsRegion();
if(!R)
return;
// if (location.getBaseKind() != SVal::LocKind)
// return;
// if (location.getSubKind() != loc::MemRegionKind)
// return;
// const ElementRegion *ER = dyn_cast<ElementRegion>(R);
// if(!ER)
// return;
ProgramStateRef state = C.getState();
ProgramStateRef notNullState, nullState;
std::tie(notNullState, nullState) = state->assume(L);
//filter some null states
if(isLoad){
if(!nullState && notNullState){
if(1){
ExplodedNode *loc = C.addTransition();
BugReport *bug = new BugReport(*this->bugType,
"checkLocation: read buffer", loc);
C.emitReport(bug);
}
}
return;
}else{
if(!nullState && notNullState){
ExplodedNode *loc = C.addTransition();
BugReport *bug = new BugReport(*this->bugType,
"checkLocation: write buffer", loc);
C.emitReport(bug);
}
}
}
extern "C"
const char clang_analyzerAPIVersionString[] = CLANG_ANALYZER_API_VERSION_STRING;
extern "C"
void clang_registerCheckers(CheckerRegistry ®istry) {
registry.addChecker <BufferAccessChecker>("alpha.core.BufferAccessChecker", "Checks buffer read/write");
}
The test result is as below:
clang-3.4 -Xclang -load -Xclang ~/bufferaccesschecker/checker.so -Xclang -analyzer-checker=alpha.core.BufferAccessChecker -Xclang -analyze -w -c ~/playground/ep2AED/Kmp.c
/home/chaz/playground/ep2AED/Kmp.c:17:14: warning: checkLocation: write buffer
falha[0] = 0;
~~~~~~~~~^~~
/home/chaz/playground/ep2AED/Kmp.c:18:12: warning: checkLocation: read buffer
while (i<tamanhoPadrao) {
^
/home/chaz/playground/ep2AED/Kmp.c:19:18: warning: checkLocation: read buffer
if (p[i] == p[j]) {
~~~~~^~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:20:21: warning: checkLocation: write buffer
falha[i]= j+1;
~~~~~~~~^~~~~
/home/chaz/playground/ep2AED/Kmp.c:26:21: warning: checkLocation: write buffer
falha[i]=0;
~~~~~~~~^~
/home/chaz/playground/ep2AED/Kmp.c:26:22: warning: checkLocation: read buffer
falha[i]=0;
^
/home/chaz/playground/ep2AED/Kmp.c:27:13: warning: checkLocation: read buffer
i++;
^~~
/home/chaz/playground/ep2AED/Kmp.c:36:18: warning: checkLocation: read buffer
int* falha = funcaoDeFalha(p);
^~~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:38:13: warning: checkLocation: read buffer
while (*i < tamanhoTexto) {
^
/home/chaz/playground/ep2AED/Kmp.c:38:15: warning: checkLocation: read buffer
while (*i < tamanhoTexto) {
~~~^~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:38:17: warning: checkLocation: read buffer
while (*i < tamanhoTexto) {
^~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:39:9: warning: checkLocation: read buffer
if(texto[*i] == p[*j]){ //match
^~
/home/chaz/playground/ep2AED/Kmp.c:39:12: warning: checkLocation: read buffer
if(texto[*i] == p[*j]){ //match
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:39:19: warning: checkLocation: read buffer
if(texto[*i] == p[*j]){ //match
^
/home/chaz/playground/ep2AED/Kmp.c:39:22: warning: checkLocation: read buffer
if(texto[*i] == p[*j]){ //match
~~~~~~~~~~^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:39:28: warning: checkLocation: read buffer
if(texto[*i] == p[*j]){ //match
^
/home/chaz/playground/ep2AED/Kmp.c:40:17: warning: checkLocation: read buffer
if(*j == tamanhoPadrao - 1){
^
/home/chaz/playground/ep2AED/Kmp.c:40:22: warning: checkLocation: read buffer
if(*j == tamanhoPadrao - 1){
^~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:41:26: warning: checkLocation: read buffer
return (*i-*j);
^
/home/chaz/playground/ep2AED/Kmp.c:43:17: warning: checkLocation: read buffer
(*i)++;
^~~~~~
/home/chaz/playground/ep2AED/Kmp.c:43:19: warning: checkLocation: read buffer
(*i)++;
^
/home/chaz/playground/ep2AED/Kmp.c:44:17: warning: checkLocation: read buffer
(*j)++;
^~~~~~
/home/chaz/playground/ep2AED/Kmp.c:44:19: warning: checkLocation: read buffer
(*j)++;
^
/home/chaz/playground/ep2AED/Kmp.c:48:17: warning: checkLocation: read buffer
if(*j>0){
^
/home/chaz/playground/ep2AED/Kmp.c:49:22: warning: checkLocation: read buffer
(*j) = falha[*j-1];
~~~~~^~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:49:31: warning: checkLocation: read buffer
(*j) = falha[*j-1];
^
/home/chaz/playground/ep2AED/Kmp.c:51:17: warning: checkLocation: read buffer
(*i)++;
^~~~~~
/home/chaz/playground/ep2AED/Kmp.c:51:19: warning: checkLocation: read buffer
(*i)++;
^
/home/chaz/playground/ep2AED/Kmp.c:55:13: warning: checkLocation: read buffer
return -1;
^
/home/chaz/playground/ep2AED/Kmp.c:56:1: warning: checkLocation: read buffer
}
^
/home/chaz/playground/ep2AED/Kmp.c:65:5: warning: checkLocation: read buffer
int i = KMPMatch(texto, p, &iKmp, &jKmp);
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:65:33: warning: checkPreStmt: buffer access
int i = KMPMatch(texto, p, &iKmp, &jKmp);
^~~~
/home/chaz/playground/ep2AED/Kmp.c:65:40: warning: checkPreStmt: buffer access
int i = KMPMatch(texto, p, &iKmp, &jKmp);
^~~~
/home/chaz/playground/ep2AED/Kmp.c:66:5: warning: checkLocation: read buffer
if(texto[strlen(p)] == ' '){
^~
/home/chaz/playground/ep2AED/Kmp.c:66:8: warning: checkLocation: read buffer
if(texto[strlen(p)] == ' '){
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:67:21: warning: checkLocation: write buffer
resposta[0] = i;
~~~~~~~~~~~~^~~
/home/chaz/playground/ep2AED/Kmp.c:67:23: warning: checkLocation: read buffer
resposta[0] = i;
^
/home/chaz/playground/ep2AED/Kmp.c:68:9: warning: checkLocation: read buffer
iterador++;
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:68:9: warning: checkLocation: read buffer
iterador++;
^~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:71:21: warning: checkLocation: write buffer
resposta[0] = -1;
~~~~~~~~~~~~^~~~
/home/chaz/playground/ep2AED/Kmp.c:72:9: warning: checkLocation: read buffer
iterador++;
^~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:74:5: warning: checkLocation: read buffer
while (i < strlen(texto) && i != -1){
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:74:12: warning: checkLocation: read buffer
while (i < strlen(texto) && i != -1){
^
/home/chaz/playground/ep2AED/Kmp.c:74:14: warning: checkLocation: read buffer
while (i < strlen(texto) && i != -1){
~~^~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:74:16: warning: checkLocation: read buffer
while (i < strlen(texto) && i != -1){
^~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:74:23: warning: checkLocation: read buffer
while (i < strlen(texto) && i != -1){
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:74:30: warning: checkLocation: read buffer
while (i < strlen(texto) && i != -1){
~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:74:33: warning: checkLocation: read buffer
while (i < strlen(texto) && i != -1){
^
/home/chaz/playground/ep2AED/Kmp.c:75:9: warning: checkLocation: read buffer
i = KMPMatch(texto, p , &iKmp,&jKmp);
^
/home/chaz/playground/ep2AED/Kmp.c:75:11: warning: checkLocation: read buffer
i = KMPMatch(texto, p , &iKmp,&jKmp);
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:75:13: warning: checkLocation: read buffer
i = KMPMatch(texto, p , &iKmp,&jKmp);
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:75:22: warning: checkLocation: read buffer
i = KMPMatch(texto, p , &iKmp,&jKmp);
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:75:34: warning: checkLocation: read buffer
i = KMPMatch(texto, p , &iKmp,&jKmp);
^~~~
/home/chaz/playground/ep2AED/Kmp.c:75:34: warning: checkPreStmt: buffer access
i = KMPMatch(texto, p , &iKmp,&jKmp);
^~~~
/home/chaz/playground/ep2AED/Kmp.c:75:40: warning: checkLocation: read buffer
i = KMPMatch(texto, p , &iKmp,&jKmp);
^~~~
/home/chaz/playground/ep2AED/Kmp.c:75:40: warning: checkPreStmt: buffer access
i = KMPMatch(texto, p , &iKmp,&jKmp);
^~~~
/home/chaz/playground/ep2AED/Kmp.c:76:9: warning: checkLocation: read buffer
if(texto[i-1] == ' '){
^~
/home/chaz/playground/ep2AED/Kmp.c:76:12: warning: checkLocation: read buffer
if(texto[i-1] == ' '){
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:76:18: warning: checkLocation: read buffer
if(texto[i-1] == ' '){
^
/home/chaz/playground/ep2AED/Kmp.c:78:32: warning: checkLocation: read buffer
resposta[iterador] = i;
~~~~~~~~~~~~~~~~~~~^~~
/home/chaz/playground/ep2AED/Kmp.c:78:32: warning: checkLocation: write buffer
resposta[iterador] = i;
~~~~~~~~~~~~~~~~~~~^~~
/home/chaz/playground/ep2AED/Kmp.c:79:13: warning: checkLocation: read buffer
iterador++;
^~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:82:6: warning: checkLocation: read buffer
*controle = iterador;
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:82:15: warning: checkLocation: read buffer
*controle = iterador;
~~~~~~~~~~^~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:82:17: warning: checkLocation: read buffer
*controle = iterador;
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:83:5: warning: checkLocation: read buffer
return resposta;
^~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:83:12: warning: checkLocation: read buffer
return resposta;
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:84:1: warning: checkLocation: read buffer
}
^
/home/chaz/playground/ep2AED/Kmp.c:92:15: warning: checkLocation: read buffer
while(i < *controle){
^
/home/chaz/playground/ep2AED/Kmp.c:92:20: warning: checkLocation: read buffer
while(i < *controle){
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:93:16: warning: checkLocation: read buffer
if(resposta[0] == -1)//nao existe a palavra
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:93:16: warning: checkLocation: read buffer
if(resposta[0] == -1)//nao existe a palavra
^~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:94:39: warning: checkLocation: read buffer
printf("%d", resposta[0]);
^
/home/chaz/playground/ep2AED/Kmp.c:95:37: warning: checkLocation: read buffer
else if(resposta[i] != -1){
^~
/home/chaz/playground/ep2AED/Kmp.c:96:40: warning: checkLocation: read buffer
printf("%d ", resposta[i]);
^
/home/chaz/playground/ep2AED/Kmp.c:98:13: warning: checkLocation: read buffer
i++;
^~~
/home/chaz/playground/ep2AED/Kmp.c:99:10: warning: checkLocation: read buffer
}printf("\n");
^~~~~~
/home/chaz/playground/ep2AED/Kmp.c:102:9: warning: checkLocation: read buffer
while(palavras) {
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:102:15: warning: checkLocation: read buffer
while(palavras) {
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:104:13: warning: checkLocation: read buffer
int *resposta = ChamaKMP(texto, palavras,numeroDePadroes, controle);
^~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:104:29: warning: checkLocation: read buffer
int *resposta = ChamaKMP(texto, palavras,numeroDePadroes, controle);
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:104:29: warning: checkLocation: read buffer
int *resposta = ChamaKMP(texto, palavras,numeroDePadroes, controle);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:104:38: warning: checkLocation: read buffer
int *resposta = ChamaKMP(texto, palavras,numeroDePadroes, controle);
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:104:45: warning: checkLocation: read buffer
int *resposta = ChamaKMP(texto, palavras,numeroDePadroes, controle);
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:104:54: warning: checkLocation: read buffer
int *resposta = ChamaKMP(texto, palavras,numeroDePadroes, controle);
^~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:104:71: warning: checkLocation: read buffer
int *resposta = ChamaKMP(texto, palavras,numeroDePadroes, controle);
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:105:13: warning: checkLocation: read buffer
while(i < *controle){
^~~~~
/home/chaz/playground/ep2AED/Kmp.c:105:19: warning: checkLocation: read buffer
while(i < *controle){
^
/home/chaz/playground/ep2AED/Kmp.c:105:24: warning: checkLocation: read buffer
while(i < *controle){
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:106:17: warning: checkLocation: read buffer
if(resposta[0] == -1)//nao existe a palavra
^~
/home/chaz/playground/ep2AED/Kmp.c:106:20: warning: checkLocation: read buffer
if(resposta[0] == -1)//nao existe a palavra
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:106:32: warning: checkLocation: read buffer
if(resposta[0] == -1)//nao existe a palavra
~~~~~~~~~~~~^~~~~
/home/chaz/playground/ep2AED/Kmp.c:107:21: warning: checkLocation: read buffer
printf("%d", resposta[0]);
^~~~~~
/home/chaz/playground/ep2AED/Kmp.c:107:21: warning: checkLocation: read buffer
printf("%d", resposta[0]);
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:107:34: warning: checkLocation: read buffer
printf("%d", resposta[0]);
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:108:25: warning: checkLocation: read buffer
else if(resposta[i] != -1){
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:108:34: warning: checkLocation: read buffer
else if(resposta[i] != -1){
^
/home/chaz/playground/ep2AED/Kmp.c:108:37: warning: checkLocation: read buffer
else if(resposta[i] != -1){
~~~~~~~~~~~~^~~~~
/home/chaz/playground/ep2AED/Kmp.c:109:21: warning: checkLocation: read buffer
printf("%d ", resposta[i]);
^~~~~~
/home/chaz/playground/ep2AED/Kmp.c:109:21: warning: checkLocation: read buffer
printf("%d ", resposta[i]);
^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:109:35: warning: checkLocation: read buffer
printf("%d ", resposta[i]);
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:109:44: warning: checkLocation: read buffer
printf("%d ", resposta[i]);
^
/home/chaz/playground/ep2AED/Kmp.c:111:17: warning: checkLocation: read buffer
i++;
^
/home/chaz/playground/ep2AED/Kmp.c:111:17: warning: checkLocation: read buffer
i++;
^~~
/home/chaz/playground/ep2AED/Kmp.c:112:14: warning: checkLocation: read buffer
}printf("\n");
^~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:112:21: warning: checkLocation: read buffer
}printf("\n");
^~~~
/home/chaz/playground/ep2AED/Kmp.c:113:13: warning: checkLocation: read buffer
i = 0;
^
/home/chaz/playground/ep2AED/Kmp.c:113:15: warning: checkLocation: read buffer
i = 0;
~~^~~
/home/chaz/playground/ep2AED/Kmp.c:114:22: warning: checkLocation: read buffer
palavras = strtok(NULL, " ");
~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:114:24: warning: checkLocation: read buffer
palavras = strtok(NULL, " ");
^~~~~~~~~~~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:117:1: warning: checkLocation: read buffer
}
Here are some unsatisfied test results selected:
int type variable should be filtered
/home/chaz/playground/ep2AED/Kmp.c:27:13: warning: checkLocation: read buffer
i++;
return expression should be filtered
/home/chaz/playground/ep2AED/Kmp.c:55:13: warning: checkLocation: read buffer
return -1;
/home/chaz/playground/ep2AED/Kmp.c:56:1: warning: checkLocation: read buffer
}
This arises twice
/home/chaz/playground/ep2AED/Kmp.c:68:9: warning: checkLocation: read buffer
iterador++;
^~~~~~~~
/home/chaz/playground/ep2AED/Kmp.c:68:9: warning: checkLocation: read buffer
iterador++;
^~~~~~~~~~
BTW, the test code is here: https://github.com/lucascapalbo/ep2AED
the test command is here:
clang-3.4 -Xclang -load -Xclang ~/bufferaccesschecker/checker.so -Xclang -analyzer-checker=alpha.core.BufferAccessChecker -Xclang -analyze -w -c ~/playground/ep2AED/Kmp.c
The problem was solved with the help of Artem Dergachev.
Super thanks to him.
The solution idea is as below:
(1) dump the stmt by Stmt.dump() and you can see the ast tree
(2) according to the ast tree, you can dyn_cast stmt into different expr type. And then you can get QualType by expr.getType(). Then, we can filter the pointer type by isAnyPointerType()
Clang is not that hard but may be confusing to beginners (especially for me)
What you should do is to read those mateial carefully.
https://github.com/haoNoQ/clang-analyzer-guide/releases/download/v0.1/clang-analyzer-guide-v0.1.pdf
http://clang-analyzer.llvm.org/checker_dev_manual.html
When you begin to code the checker, you can always check different and confusing classes here rather than read the source code.
https://clang.llvm.org/doxygen/
Hope this helps!

How do I wrap the Cuda version of SparsePyrLKOpticalFlow using Cython?

I'm trying to wrap the Cuda version of the SparsePyrLKOpticalFlow OpenCV algorithm using Cython. So far I've based my code mostly on this post with the modifications in its answer. I think I have to initialize an instance of the SparsePyrLKOpticalFlow class and then use the member function calc that the class inherits from SparseOpticalFlow.
Here's what I have so far:
Corner_Tracker.pxd
from libcpp cimport bool
from cpython.ref cimport PyObject
from libcpp.vector cimport vector
# References PyObject to OpenCV object conversion code borrowed from OpenCV's own conversion file, cv2.cpp
cdef extern from 'pyopencv_converter.cpp':
cdef void import_array()
cdef PyObject* pyopencv_from(const Mat& m)
cdef bool pyopencv_to(PyObject* o, Mat& m)
cdef extern from 'opencv2/imgproc.hpp' namespace 'cv':
cdef enum InterpolationFlags:
INTER_NEAREST = 0
cdef enum ColorConversionCodes:
COLOR_BGR2GRAY
cdef extern from 'opencv2/core/core.hpp':
cdef int CV_8UC1
cdef int CV_32FC1
cdef extern from 'opencv2/core/core.hpp' namespace 'cv':
cdef cppclass Size_[T]:
Size_() except +
Size_(T width, T height) except +
T width
T height
ctypedef Size_[int] Size2i
ctypedef Size2i Size
cdef cppclass Scalar[T]:
Scalar() except +
Scalar(T v0) except +
cdef extern from 'opencv2/core/core.hpp' namespace 'cv':
cdef cppclass Mat:
Mat() except +
void create(int, int, int) except +
void* data
int rows
int cols
cdef cppclass Algorithm:
Algorithm() except +
cdef extern from 'opencv2/core/cuda.hpp' namespace 'cv::cuda':
cdef cppclass GpuMat:
GpuMat() except +
void upload(Mat arr) except +
void download(Mat dst) const
cdef cppclass Stream:
Stream() except +
cdef extern from 'opencv2/core/cvstd.hpp' namespace 'cv':
cdef cppclass Ptr[T]:
Ptr() except +
Ptr(Ptr*) except +
T& operator* () except +
cdef extern from 'opencv2/cudaoptflow.hpp' namespace 'cv::cuda':
cdef cppclass SparseOpticalFlow:
void calc(GpuMat prevImg, GpuMat nextImg, GpuMat prevPts, GpuMat nextPts, GpuMat status) except +
cdef extern from 'opencv2/cudaoptflow.hpp' namespace 'cv::cuda::SparsePyrLKOpticalFlow':
cdef cppclass SparsePyrLKOpticalFlow(SparseOpticalFlow):
#staticmethod
Ptr[SparsePyrLKOpticalFlow] create(Size winSize, int maxLevel) except +
I suspect I'm not entering the calc argument types correctly, but I'm not sure what else to do.
Corner_Tracker.pyx
import numpy as np
import cv2
cimport numpy as np
from cython.operator cimport dereference
def cudaCalcFlowWrapper(
np.ndarray[np.uint8_t, ndim=2] prevImg,
np.ndarray[np.uint8_t, ndim=2] nextImg,
np.ndarray[np.float32_t, ndim=2] prevPts):
np.import_array()
cdef Ptr[SparsePyrLKOpticalFlow] flow_tracker = SparsePyrLKOpticalFlow.create(Size(15,15), 2)
cdef Mat prevImgMat
cdef GpuMat prevImgGpu
pyopencv_to(<PyObject*> prevImg, prevImgMat)
prevImgGpu.upload(prevImgMat)
cdef Mat nextImgMat
cdef GpuMat nextImgGpu
pyopencv_to(<PyObject*> nextImg, nextImgMat)
nextImgGpu.upload(nextImgMat)
cdef Mat prevPtsMat = Mat()
cdef GpuMat prevPtsGpu
pyopencv_to(<PyObject*> prevPts, prevPtsMat)
prevPtsGpu.upload(prevPtsMat)
cdef Mat nextPtsMat
cdef Mat statusMat
cdef GpuMat nextPtsGpu
cdef GpuMat statusGpu
dereference(flow_tracker).calc(prevImgGpu, nextImgGpu, prevPtsGpu, nextPtsGpu, statusGpu)
nextPtsGpu.download(nextPtsMat)
statusGpu.download(statusMat)
cdef np.ndarray nextPts = <np.ndarray> pyopencv_from(nextPtsMat)
cdef np.ndarray status = <np.ndarray> pyopencv_from(statusMat)
return nextPts, status
setup.py
import subprocess
import os
import numpy as np
from distutils.core import setup, Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
# Determine current directory of this setup file to find our module
CUR_DIR = os.path.dirname(__file__)
# Use pkg-config to determine library locations and include locations
opencv_libs_str = subprocess.check_output("pkg-config --libs opencv".split()).decode()
opencv_incs_str = subprocess.check_output("pkg-config --cflags opencv".split()).decode()
# Parse into usable format for Extension call
opencv_libs = [str(lib) for lib in opencv_libs_str.strip().split()]
opencv_incs = [str(inc) for inc in opencv_incs_str.strip().split()]
extensions = [
Extension('Corner_Tracker',
sources=[os.path.join(CUR_DIR, 'Corner_Tracker.pyx')],
language='c++',
include_dirs=[np.get_include()] + opencv_incs,
extra_link_args=opencv_libs)
]
setup(
cmdclass={'build_ext': build_ext},
name="Corner_Tracker",
ext_modules=cythonize(extensions)
)
When I run python setup.py build_ext --inplace, I get this:
Compiling Corner_Tracker.pyx because it changed.
[1/1] Cythonizing Corner_Tracker.pyx
running build_ext
building 'Corner_Tracker' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/sccarey/.virtualenvs/cv/local/lib/python2.7/site-packages/numpy/core/include -I-I/usr/local/include/opencv -I-I/usr/local/include -I/usr/include/python2.7 -c Corner_Tracker.cpp -o build/temp.linux-x86_64-2.7/Corner_Tracker.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/sccarey/.virtualenvs/cv/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816:0,
from /home/sccarey/.virtualenvs/cv/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from pyopencv_converter.cpp:2,
from Corner_Tracker.cpp:623:
/home/sccarey/.virtualenvs/cv/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^
Corner_Tracker.cpp: In function ‘PyObject* __pyx_pf_14Corner_Tracker_cudaCalcFlowWrapper(PyObject*, PyArrayObject*, PyArrayObject*, PyArrayObject*)’:
Corner_Tracker.cpp:1843:67: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct cv::Ptr’
cv::Ptr<cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow> __pyx_v_flow_tracker;
^
Corner_Tracker.cpp:1843:67: note: expected a type, got ‘cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow’
Corner_Tracker.cpp:1866:67: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct cv::Ptr’
cv::Ptr<cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow> __pyx_t_3;
^
Corner_Tracker.cpp:1866:67: note: expected a type, got ‘cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow’
Corner_Tracker.cpp:1868:3: error: ‘cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow’ names the constructor, not the type
cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow __pyx_t_5;
^
Corner_Tracker.cpp:1868:60: error: expected ‘;’ before ‘__pyx_t_5’
cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow __pyx_t_5;
^
Corner_Tracker.cpp:1868:69: error: statement cannot resolve address of overloaded function
cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow __pyx_t_5;
^
Corner_Tracker.cpp:1923:81: error: invalid user-defined conversion from ‘cv::Ptr<cv::cuda::SparsePyrLKOpticalFlow>’ to ‘int’ [-fpermissive]
__pyx_t_3 = cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow::create(__pyx_t_2, 2);
^
In file included from /usr/local/include/opencv2/core/cvstd.hpp:1067:0,
from /usr/local/include/opencv2/core/base.hpp:56,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/core/core.hpp:48,
from pyopencv_converter.cpp:3,
from Corner_Tracker.cpp:623:
/usr/local/include/opencv2/core/ptr.inl.hpp:222:1: note: candidate is: cv::Ptr<T>::operator T*() const [with T = cv::cuda::SparsePyrLKOpticalFlow] <near match>
Ptr<T>::operator T* () const
^
/usr/local/include/opencv2/core/ptr.inl.hpp:222:1: note: no known conversion from ‘cv::cuda::SparsePyrLKOpticalFlow*’ to ‘int’
Corner_Tracker.cpp:2022:5: error: ‘__pyx_t_5’ was not declared in this scope
__pyx_t_5 = * __pyx_v_flow_tracker;
^
Corner_Tracker.cpp:2022:19: error: invalid type argument of unary ‘*’ (have ‘int’)
__pyx_t_5 = * __pyx_v_flow_tracker;
^
Corner_Tracker.cpp:2028:5: error: ‘__pyx_t_5’ was not declared in this scope
__pyx_t_5.calc(__pyx_v_prevImgGpu, __pyx_v_nextImgGpu, __pyx_v_prevPtsGpu, __pyx_v_nextPtsGpu, __pyx_v_statusGpu);
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I've been playing around with it for a couple days, but I'm starting to think I'm just in too far over my head.
Could someone please help me?
Edit: I fixed an unrelated error by replacing the memoryviews in the wrapper arguments with numpy arrays.
Edit: After applying the changes that #DavidW suggested, I'm getting this new error:
Corner_Tracker.cpp: In function ‘PyObject* __pyx_pf_14Corner_Tracker_cudaCalcFlowWrapper(PyObject*, PyArrayObject*, PyArrayObject*, PyArrayObject*)’:
Corner_Tracker.cpp:1868:36: error: cannot declare variable ‘__pyx_t_5’ to be of abstract type ‘cv::cuda::SparsePyrLKOpticalFlow’
cv::cuda::SparsePyrLKOpticalFlow __pyx_t_5;
^
In file included from Corner_Tracker.cpp:628:0:
/usr/local/include/opencv2/cudaoptflow.hpp:160:18: note: because the following virtual functions are pure within ‘cv::cuda::SparsePyrLKOpticalFlow’:
class CV_EXPORTS SparsePyrLKOpticalFlow : public SparseOpticalFlow
^
/usr/local/include/opencv2/cudaoptflow.hpp:99:18: note: virtual void cv::cuda::SparseOpticalFlow::calc(cv::InputArray, cv::InputArray, cv::InputArray, cv::InputOutputArray, cv::OutputArray, cv::OutputArray, cv::cuda::Stream&)
virtual void calc(InputArray prevImg, InputArray nextImg,
^
/usr/local/include/opencv2/cudaoptflow.hpp:163:18: note: virtual cv::Size cv::cuda::SparsePyrLKOpticalFlow::getWinSize() const
virtual Size getWinSize() const = 0;
^
/usr/local/include/opencv2/cudaoptflow.hpp:164:18: note: virtual void cv::cuda::SparsePyrLKOpticalFlow::setWinSize(cv::Size)
virtual void setWinSize(Size winSize) = 0;
^
/usr/local/include/opencv2/cudaoptflow.hpp:166:17: note: virtual int cv::cuda::SparsePyrLKOpticalFlow::getMaxLevel() const
virtual int getMaxLevel() const = 0;
^
/usr/local/include/opencv2/cudaoptflow.hpp:167:18: note: virtual void cv::cuda::SparsePyrLKOpticalFlow::setMaxLevel(int)
virtual void setMaxLevel(int maxLevel) = 0;
^
/usr/local/include/opencv2/cudaoptflow.hpp:169:17: note: virtual int cv::cuda::SparsePyrLKOpticalFlow::getNumIters() const
virtual int getNumIters() const = 0;
^
/usr/local/include/opencv2/cudaoptflow.hpp:170:18: note: virtual void cv::cuda::SparsePyrLKOpticalFlow::setNumIters(int)
virtual void setNumIters(int iters) = 0;
^
/usr/local/include/opencv2/cudaoptflow.hpp:172:18: note: virtual bool cv::cuda::SparsePyrLKOpticalFlow::getUseInitialFlow() const
virtual bool getUseInitialFlow() const = 0;
^
/usr/local/include/opencv2/cudaoptflow.hpp:173:18: note: virtual void cv::cuda::SparsePyrLKOpticalFlow::setUseInitialFlow(bool)
virtual void setUseInitialFlow(bool useInitialFlow) = 0;
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Based on the error messages your main problem is the namespace declaration
cdef extern from 'opencv2/cudaoptflow.hpp' namespace 'cv::cuda::SparsePyrLKOpticalFlow':
cdef cppclass SparsePyrLKOpticalFlow(SparseOpticalFlow):
# ...
The compiler output is reporting that
error: ‘cv::cuda::SparsePyrLKOpticalFlow::SparsePyrLKOpticalFlow’ names the constructor, not the type
Therefore you want to change the namespace for this class to 'cv::cuda'.
This isn't the bug but if you declare pyopencv_from/to as
cdef object pyopencv_from(const Mat& m)
cdef bool pyopencv_to(object, Mat& m)
then you won't have to cast to PyObject*
The issue you're having with abstract variables comes from the line
dereference(flow_tracker).calc(prevImgGpu, nextImgGpu, prevPtsGpu, nextPtsGpu, statusGpu)
It's because it's trying to do (roughly):
SparsePyrLKOptical tmp_variable
try {
tmp_variable = dereference(flow_tracker)
}
catch(...) {
// handle errors
}
tmp_variable.calc(...)
Since SparsePyrLKOptical is abstract you can only create derived classes of it, but not actually the class directly.
If you remove except + from the line T& operator* () except + then Cython won't create the error checking code and so won't need the temporary. I suspect that this is right and that operator* can't actually throw an exception, but it has the potential to stop your program if it can.

Cordova paypal plugin error in running in ios ionicframework

I installed cordova paypal plugin in my ionic framework app, the app is working fine in android but when I try too run for IOS it's showing error build failed,
** BUILD FAILED **
The following build commands failed:
CompileC build/HairDiction.build/Debug-iphonesimulator/HairDiction.build/Objects-normal/i386/PayPalMobileCordovaPlugin.o HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/cordova/build-debug.xcconfig,-project,HairDiction.xcodeproj,ARCHS=i386,-target,HairDiction,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/build/sharedpch
and
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:14:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const kPayPalOAuth2ScopeFuturePayments;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:16:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const kPayPalOAuth2ScopeProfile;
^
;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:16:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const kPayPalOAuth2ScopeProfile;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:18:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const kPayPalOAuth2ScopeOpenId;
^
;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:18:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const kPayPalOAuth2ScopeOpenId;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:20:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const kPayPalOAuth2ScopePayPalAttributes;
^
;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:20:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const kPayPalOAuth2ScopePayPalAttributes;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:22:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const kPayPalOAuth2ScopeEmail;
^
;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:22:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const kPayPalOAuth2ScopeEmail;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:24:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const kPayPalOAuth2ScopeAddress;^;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:24:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const kPayPalOAuth2ScopeAddress;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:26:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const kPayPalOAuth2ScopePhone;^;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalOAuthScopes.h:26:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const kPayPalOAuth2ScopePhone;
~~~~~ ^
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:6:
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.h:8:
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:16:
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalPaymentViewController.h:81:38: warning: pointer is missing a nullability type specifier (__nonnull or __nullable) [-Wnullability-completeness]
#property(nonatomic, weak, readonly) id paymentDelegate; ^
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:6:
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.h:8:
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:17:
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalProfileSharingViewController.h:68:39: warning: pointer is missing a nullability type specifier (__nonnull or __nullable) [-Wnullability-completeness]
#property (nonatomic, weak, readonly) id profileSharingDelegate;^
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:6:
In file included from /Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.h:8:
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:21:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const PayPalEnvironmentProduction;^;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:21:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const PayPalEnvironmentProduction;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:23:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const PayPalEnvironmentSandbox;^;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:23:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const PayPalEnvironmentSandbox;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:25:27: error: expected ';' after top level declarator
extern NSString * _Nonnull const PayPalEnvironmentNoNetwork;^;
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:25:34: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern NSString * _Nonnull const PayPalEnvironmentNoNetwork;
~~~~~ ^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobile.h:21:17: warning: pointer is missing a nullability type specifier (__nonnull or __nullable) [-Wnullability-completeness]
extern NSString * _Nonnull const PayPalEnvironmentProduction;
^
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:34:33: error: collection element of type 'int' is not an Objective-C object
NSDictionary* clientIds = #{PayPalEnvironmentProduction: clientIdsReceived[#"PayPalEnvironmentProduction"],
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:208:24: error: implicit conversion of 'int' to 'NSString *' is disallowed with ARC
environmentToUse = PayPalEnvironmentNoNetwork;
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:208:22: warning: incompatible integer to pointer conversion assigning to 'NSString *__strong' from 'const int' [-Wint-conversion]
environmentToUse = PayPalEnvironmentNoNetwork;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:210:24: error: implicit conversion of 'int' to 'NSString *' is disallowed with ARC
environmentToUse = PayPalEnvironmentProduction;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:210:22: warning: incompatible integer to pointer conversion assigning to 'NSString *__strong' from 'const int' [-Wint-conversion]
environmentToUse = PayPalEnvironmentProduction;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:212:24: error: implicit conversion of 'int' to 'NSString *' is disallowed with ARC
environmentToUse = PayPalEnvironmentSandbox;
^~~~~~~~~~~~~~~~~~~~~~~~
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:212:22: warning: incompatible integer to pointer conversion assigning to 'NSString *__strong' from 'const int' [-Wint-conversion]
environmentToUse = PayPalEnvironmentSandbox;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/MAMP/htdocs/phonegap/hairdiction/platforms/ios/HairDiction/Plugins/com.paypal.cordova.mobilesdk/PayPalMobileCordovaPlugin.m:249:16: error: collection element of type 'int' is not an Objective-C object
#"openid": kPayPalOAuth2ScopeOpenId,
^
17 warnings and 15 errors generated.

Building OpenCV 3.1 error in hdf5.cpp

I'm going to install the OpenCV 3.1 version in my ubuntu 12.04 laptop. I follow every step in this article, but I'm getting some error in "make" command:
[ 21%] Building CXX object modules/hdf/CMakeFiles/opencv_hdf.dir/src/hdf5.cpp.o
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In constructor ‘cv::hdf::HDF5Impl::HDF5Impl(cv::String)’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:229:46: error: invalid conversion from ‘hid_t {aka int}’ to ‘herr_t (**)(void*) {aka int (**)(void*)}’ [-fpermissive]
H5Eget_auto( stackid, &errfunc, &errdata );
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:229:46: error: invalid conversion from ‘herr_t (**)(hid_t, void*) {aka int (**)(int, void*)}’ to ‘void**’ [-fpermissive]
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:229:46: error: too many arguments to function ‘herr_t H5Eget_auto1(herr_t (**)(void*), void**)’
In file included from /usr/include/hdf5.h:28:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Epublic.h:212:15: note: declared here
H5_DLL herr_t H5Eget_auto1(H5E_auto1_t *func, void **client_data);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:232:38: error: invalid conversion from ‘hid_t {aka int}’ to ‘H5E_auto1_t {aka int (*)(void*)}’ [-fpermissive]
H5Eset_auto( stackid, NULL, NULL );
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:232:38: error: too many arguments to function ‘herr_t H5Eset_auto1(H5E_auto1_t, void*)’
In file included from /usr/include/hdf5.h:28:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Epublic.h:216:15: note: declared here
H5_DLL herr_t H5Eset_auto1(H5E_auto1_t func, void *client_data);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:238:44: error: invalid conversion from ‘hid_t {aka int}’ to ‘H5E_auto1_t {aka int (*)(void*)}’ [-fpermissive]
H5Eset_auto( stackid, errfunc, errdata );
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:238:44: error: invalid conversion from ‘H5E_auto2_t {aka int (*)(int, void*)}’ to ‘void*’ [-fpermissive]
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:238:44: error: too many arguments to function ‘herr_t H5Eset_auto1(H5E_auto1_t, void*)’
In file included from /usr/include/hdf5.h:28:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Epublic.h:216:15: note: declared here
H5_DLL herr_t H5Eset_auto1(H5E_auto1_t func, void *client_data);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::grcreate(cv::String)’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:283:54: error: too many arguments to function ‘hid_t H5Gcreate1(hid_t, const char*, size_t)’
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
^
In file included from /usr/include/hdf5.h:31:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Gpublic.h:147:14: note: declared here
H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual std::vector<int> cv::hdf::HDF5Impl::dsgetsize(cv::String, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:294:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual int cv::hdf::HDF5Impl::dsgettype(cv::String) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:325:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:335:41: error: too few arguments to function ‘int H5Tget_array_dims1(hid_t, hsize_t*, int*)’
H5Tget_array_dims( dstype, ardims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Tpublic.h:612:12: note: declared here
H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dscreate(int, const int*, int, cv::String, int, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:443:35: warning: narrowing conversion of ‘channs’ from ‘int’ to ‘hsize_t {aka long long unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
hsize_t adims[1] = { channs };
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:444:50: error: too few arguments to function ‘hid_t H5Tarray_create1(hid_t, int, const hsize_t*, const int*)’
dstype = H5Tarray_create( dstype, 1, adims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Tpublic.h:609:14: note: declared here
H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:449:57: error: too many arguments to function ‘hid_t H5Dcreate1(hid_t, const char*, hid_t, hid_t, hid_t)’
dspace, H5P_DEFAULT, dsdcpl, H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:143:14: note: declared here
H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dsread(cv::OutputArray, cv::String, const int*, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:475:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:485:41: error: too few arguments to function ‘int H5Tget_array_dims1(hid_t, hsize_t*, int*)’
H5Tget_array_dims( dstype, ardims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Tpublic.h:612:12: note: declared here
H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dswrite(cv::InputArray, cv::String, const int*, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:605:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:628:35: warning: narrowing conversion of ‘channs’ from ‘int’ to ‘hsize_t {aka long long unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
hsize_t adims[1] = { channs };
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:629:50: error: too few arguments to function ‘hid_t H5Tarray_create1(hid_t, int, const hsize_t*, const int*)’
dstype = H5Tarray_create( dstype, 1, adims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Tpublic.h:609:14: note: declared here
H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dsinsert(cv::InputArray, cv::String, const int*, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:690:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:746:35: warning: narrowing conversion of ‘channs’ from ‘int’ to ‘hsize_t {aka long long unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
hsize_t adims[1] = { channs };
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:747:50: error: too few arguments to function ‘hid_t H5Tarray_create1(hid_t, int, const hsize_t*, const int*)’
dstype = H5Tarray_create( dstype, 1, adims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Tpublic.h:609:14: note: declared here
H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpcreate(int, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:841:57: error: too many arguments to function ‘hid_t H5Dcreate1(hid_t, const char*, hid_t, hid_t, hid_t)’
dspace, H5P_DEFAULT, dsdcpl, H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:143:14: note: declared here
H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpwrite(std::vector<cv::KeyPoint>, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:869:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, kplabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpinsert(std::vector<cv::KeyPoint>, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:923:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, kplabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpread(std::vector<cv::KeyPoint>&, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:990:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, kplabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27:0,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
make[2]: *** [modules/hdf/CMakeFiles/opencv_hdf.dir/src/hdf5.cpp.o] Error 1
make[1]: *** [modules/hdf/CMakeFiles/opencv_hdf.dir/all] Error 2
make: *** [all] Error 2
However, I check my hdf5 library using dpkg -l | grep hdf5, it is 1.8.4 version:
ii libhdf5-mpich-1.8.4 1.8.4-patch1-3ubuntu2 Hierarchical Data Format 5 (HDF5) - runtime files - MPICH version
ii libhdf5-mpich-dev 1.8.4-patch1-3ubuntu2 Hierarchical Data Format 5 (HDF5) - development files - MPICH version
rc libhdf5-serial-1.8.4
I'm using ubuntu 12.04 system, my gcc/g++ version is 4.8.1, Linux kernel version is 3.13.0-32-generic. Anyone know the problem?

Resources