I am writing client samples for Airavata C++ API, which includes the thrift c++ libraries. I am getting a whole lot of errors while compiling, due to the included thrift libraries. I am using the following command for compilation:
gcc -I/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/ -Wall -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H $(INC) pkg-config --cflags glib-2.0 createProject.cpp pkg-config --libs glib-2.0
I managed to figure out the problem for some, but am currently stuck at the following errors. Any suggestions on how to fix these will be helpful.
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:187:25: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:187:41: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:187:59: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:243:24: error: aggregate ‘apache::thrift::transport::TSocket::openConnection(apache::thrift::transport::addrinfo*)::sockaddr_un address’ has incomplete type and cannot be defined
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:263:31: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:263:62: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:278:29: error: elements of array ‘apache::thrift::transport::TSocket::openConnection(apache::thrift::transport::addrinfo*)::pollfd fds [1]’ have incomplete type
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:278:29: error: storage size of ‘fds’ isn’t known
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:281:19: error: ‘POLLOUT’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:282:41: error: ‘poll’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:318:25: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:318:62: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘void apache::thrift::transport::TSocket::local_open()’:
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:355:19: error: aggregate ‘apache::thrift::transport::addrinfo hints’ has incomplete type and cannot be defined
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:363:20: error: ‘AI_PASSIVE’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:363:33: error: ‘AI_ADDRCONFIG’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:366:57: error: ‘getaddrinfo’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:369:106: error: ‘gai_strerror’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:377:34: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:382:14: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:386:26: error: ‘freeaddrinfo’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:393:20: error: ‘freeaddrinfo’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘virtual uint32_t apache::thrift::transport::TSocket::read(uint8_t*, uint32_t)’:
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:434:37: error: ‘gettimeofday’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:454:37: error: ‘gettimeofday’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘std::string apache::thrift::transport::TSocket::getPeerHost()’:
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:717:21: error: ‘NI_MAXHOST’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:718:24: error: ‘NI_MAXSERV’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:721:17: error: ‘clienthost’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:722:17: error: ‘clientservice’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:722:56: error: ‘getnameinfo’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘std::string apache::thrift::transport::TSocket::getPeerAddress()’:
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:751:21: error: ‘NI_MAXHOST’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:752:24: error: ‘NI_MAXSERV’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:755:17: error: ‘clienthost’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:756:17: error: ‘clientservice’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:757:17: error: ‘NI_NUMERICHOST’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:757:32: error: ‘NI_NUMERICSERV’ was not declared in this scope
/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:757:46: error: ‘getnameinfo’ was not declared in this scope
As you have found out in the meantime ;-), just follow the steps outlined in the documentation:
cd thrift
./bootstrap.sh
./configure
make
make install
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I have written a project (consisting of several cpp and h files) in MS Visual Studio 2015 on Windows but I need to run it on Ubuntu. Is there any way I can do this? I tried by simply witting
$ g++ -std=c++0x *.cpp but I get a lot of errors:
In file included from DataTable.cpp:1:0:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
DataTable.cpp: In member function ‘void DataTable::printTable(std::ostream&)’:
DataTable.cpp:12:22: error: ‘data’ was not declared in this scope
DataTable.cpp: In member function ‘void DataTable::addData(std::string)’:
DataTable.cpp:22:8: error: ‘class DataTable’ has no member named ‘data’
In file included from ElfSymbol.h:7:0,
from ElfSymbol.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from LineParser.h:11,
from Instruction.h:5,
from Instruction.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from Instruction.h:5:0,
from Instruction.cpp:1:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
In file included from Instruction.cpp:1:0:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
Instruction.cpp: In member function ‘void Instruction::setAddr(std::string)’:
Instruction.cpp:59:2: error: ‘addr’ was not declared in this scope
Instruction.cpp: In member function ‘std::string Instruction::getAddr()’:
Instruction.cpp:64:9: error: ‘addr’ was not declared in this scope
Instruction.cpp: In member function ‘std::string Instruction::getDataString()’:
Instruction.cpp:130:15: error: ‘addr’ was not declared in this scope
Instruction.cpp:141:15: error: ‘addr’ was not declared in this scope
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from LineParser.h:11,
from LineParser.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from LineParser.h:12:0,
from LineParser.cpp:1:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
In file included from LineParser.cpp:1:0:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
LineParser.cpp:7:13: error: ‘instructionStrings’ is not a member of ‘LineParser’
LineParser.cpp:7:13: error: ‘instructionStrings’ is not a member of ‘LineParser’
LineParser.cpp:7:43: error: template argument 2 is invalid
LineParser.cpp:7:43: error: template argument 4 is invalid
LineParser.cpp:7:71: error: invalid type in declaration before ‘;’ token
LineParser.cpp: In static member function ‘static bool LineParser::isInstruction(std::string, SymbolTable)’:
LineParser.cpp:412:14: error: ‘instructionStrings’ was not declared in this scope
LineParser.cpp:412:32: error: template argument 2 is invalid
LineParser.cpp:412:32: error: template argument 4 is invalid
LineParser.cpp:412:44: error: expected initializer before ‘it’
LineParser.cpp:413:6: error: ‘it’ was not declared in this scope
LineParser.cpp:413:27: error: request for member ‘end’ in ‘LineParser::instructionMap’, which is of non-class type ‘int’
LineParser.cpp: In static member function ‘static void LineParser::initializeInsMap()’:
LineParser.cpp:1622:26: error: ‘INT’ was not declared in this scope
LineParser.cpp:1623:26: error: ‘JMP’ was not declared in this scope
LineParser.cpp:1624:27: error: ‘CALL’ was not declared in this scope
LineParser.cpp:1625:26: error: ‘RET’ was not declared in this scope
LineParser.cpp:1626:25: error: ‘JZ’ was not declared in this scope
LineParser.cpp:1627:26: error: ‘JNZ’ was not declared in this scope
LineParser.cpp:1628:26: error: ‘JGZ’ was not declared in this scope
LineParser.cpp:1629:27: error: ‘JGEZ’ was not declared in this scope
LineParser.cpp:1630:26: error: ‘JLZ’ was not declared in this scope
LineParser.cpp:1631:27: error: ‘JLEZ’ was not declared in this scope
LineParser.cpp:1633:27: error: ‘LOAD’ was not declared in this scope
LineParser.cpp:1634:29: error: ‘LOADUB’ was not declared in this scope
LineParser.cpp:1635:29: error: ‘LOADSB’ was not declared in this scope
LineParser.cpp:1636:29: error: ‘LOADUW’ was not declared in this scope
LineParser.cpp:1637:29: error: ‘LOADSW’ was not declared in this scope
LineParser.cpp:1639:28: error: ‘STORE’ was not declared in this scope
LineParser.cpp:1640:29: error: ‘STOREB’ was not declared in this scope
LineParser.cpp:1641:29: error: ‘STOREW’ was not declared in this scope
LineParser.cpp:1643:27: error: ‘PUSH’ was not declared in this scope
LineParser.cpp:1644:26: error: ‘POP’ was not declared in this scope
LineParser.cpp:1646:26: error: ‘ADD’ was not declared in this scope
LineParser.cpp:1647:26: error: ‘SUB’ was not declared in this scope
LineParser.cpp:1648:26: error: ‘MUL’ was not declared in this scope
LineParser.cpp:1649:26: error: ‘DIV’ was not declared in this scope
LineParser.cpp:1650:26: error: ‘MOD’ was not declared in this scope
LineParser.cpp:1651:26: error: ‘AND’ was not declared in this scope
LineParser.cpp:1652:25: error: ‘OR’ was not declared in this scope
LineParser.cpp:1653:26: error: ‘XOR’ was not declared in this scope
LineParser.cpp:1654:26: error: ‘NOT’ was not declared in this scope
LineParser.cpp:1655:26: error: ‘ASL’ was not declared in this scope
LineParser.cpp:1656:26: error: ‘ASR’ was not declared in this scope
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from main.cpp:9:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from LineParser.h:12:0,
from SymbolTable.h:7,
from main.cpp:9:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
In file included from SymbolTable.h:7:0,
from main.cpp:9:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from SymbolTable.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from LineParser.h:12:0,
from SymbolTable.h:7,
from SymbolTable.cpp:1:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
In file included from SymbolTable.h:7:0,
from SymbolTable.cpp:1:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
But it all worked without an error on VS.
Ubuntu 12.04 ships with GCC 4.6.3. This very old version does not implement some C++11 features. You can find out which features are available on C++0x Support in GCC 4.6. As you can see from this list »Non-static data member initializers« is simply not implemented, which is exactly what the compiler is telling you.
Better use a more recent compiler (GCC ≥ 4.8.1), or even better, update your OS! Otherwise this question should be migrated to https://retrocomputing.stackexchange.com/
I built flann using cmake and then I ran my program and had the following errors:
**** Build of configuration Debug for project test1 ****
make all Building file: ../src/test1.cpp Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test1.d"
-MT"src/test1.d" -o"src/test1.o" "../src/test1.cpp" In file included from ../src/test1.cpp:3: /usr/local/include/flann/io/hdf5.h:45: error:
expected constructor, destructor, or type conversion before
‘get_hdf5_type’ /usr/local/include/flann/io/hdf5.h:51: error: expected
constructor, destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:53: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:55: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:57: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:59: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:61: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:63: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:65: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:67: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:69: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h:71: error: expected constructor,
destructor, or type conversion before ‘get_hdf5_type’
/usr/local/include/flann/io/hdf5.h: In function ‘void
flann::save_to_file(const flann::Matrix&, const std::string&, const
std::string&)’: /usr/local/include/flann/io/hdf5.h:84: error: there
are no arguments to ‘H5Eset_auto’ that depend on a template parameter,
so a declaration of ‘H5Eset_auto’ must be available
/usr/local/include/flann/io/hdf5.h:84: note: (if you use
‘-fpermissive’, G++ will accept your code, but allowing the use of an
undeclared name is deprecated) /usr/local/include/flann/io/hdf5.h:87:
error: ‘herr_t’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:87: error: expected ‘;’ before
‘status’ /usr/local/include/flann/io/hdf5.h:88: error: ‘hid_t’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:88: error:
expected ‘;’ before ‘file_id’ /usr/local/include/flann/io/hdf5.h:89:
error: ‘file_id’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:89: error: ‘H5F_ACC_RDWR’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:89: error:
‘H5P_DEFAULT’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:89: error: there are no arguments
to ‘H5Fopen’ that depend on a template parameter, so a declaration of
‘H5Fopen’ must be available /usr/local/include/flann/io/hdf5.h:91:
error: ‘H5F_ACC_EXCL’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:91: error: there are no arguments
to ‘H5Fcreate’ that depend on a template parameter, so a declaration
of ‘H5Fcreate’ must be available
/usr/local/include/flann/io/hdf5.h:95: error: ‘hsize_t’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:95: error:
expected ‘;’ before ‘dimsf’ /usr/local/include/flann/io/hdf5.h:96:
error: ‘dimsf’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:99: error: expected ‘;’ before
‘space_id’ /usr/local/include/flann/io/hdf5.h:100: error: expected ‘;’
before ‘memspace_id’ /usr/local/include/flann/io/hdf5.h:102: error:
expected ‘;’ before ‘dataset_id’
/usr/local/include/flann/io/hdf5.h:106: error: ‘dataset_id’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:106: error:
‘get_hdf5_type’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:106: error: expected
primary-expression before ‘>’ token
/usr/local/include/flann/io/hdf5.h:106: error: expected
primary-expression before ‘)’ token
/usr/local/include/flann/io/hdf5.h:106: error: ‘space_id’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:106: error:
there are no arguments to ‘H5Dcreate’ that depend on a template
parameter, so a declaration of ‘H5Dcreate’ must be available
/usr/local/include/flann/io/hdf5.h:113: error: there are no arguments
to ‘H5Dopen’ that depend on a template parameter, so a declaration of
‘H5Dopen’ must be available /usr/local/include/flann/io/hdf5.h:118:
error: ‘status’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:118: error: expected
primary-expression before ‘>’ token
/usr/local/include/flann/io/hdf5.h:118: error: expected
primary-expression before ‘)’ token
/usr/local/include/flann/io/hdf5.h:118: error: ‘memspace_id’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:121: error:
there are no arguments to ‘H5Sclose’ that depend on a template
parameter, so a declaration of ‘H5Sclose’ must be available
/usr/local/include/flann/io/hdf5.h:122: error: there are no arguments
to ‘H5Sclose’ that depend on a template parameter, so a declaration of
‘H5Sclose’ must be available /usr/local/include/flann/io/hdf5.h:123:
error: there are no arguments to ‘H5Dclose’ that depend on a template
parameter, so a declaration of ‘H5Dclose’ must be available
/usr/local/include/flann/io/hdf5.h:124: error: there are no arguments
to ‘H5Fclose’ that depend on a template parameter, so a declaration of
‘H5Fclose’ must be available /usr/local/include/flann/io/hdf5.h: In
function ‘void flann::load_from_file(flann::Matrix&, const
std::string&, const std::string&)’:
/usr/local/include/flann/io/hdf5.h:132: error: ‘herr_t’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:132: error:
expected ‘;’ before ‘status’ /usr/local/include/flann/io/hdf5.h:133:
error: ‘hid_t’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:133: error: expected ‘;’ before
‘file_id’ /usr/local/include/flann/io/hdf5.h:134: error: ‘file_id’ was
not declared in this scope /usr/local/include/flann/io/hdf5.h:136:
error: expected ‘;’ before ‘dataset_id’
/usr/local/include/flann/io/hdf5.h:140: error: ‘dataset_id’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:140: error:
‘file_id’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:140: error: there are no arguments
to ‘H5Dopen’ that depend on a template parameter, so a declaration of
‘H5Dopen’ must be available /usr/local/include/flann/io/hdf5.h:144:
error: expected ‘;’ before ‘space_id’
/usr/local/include/flann/io/hdf5.h:146: error: ‘hsize_t’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:146: error:
expected ‘;’ before ‘dims_out’ /usr/local/include/flann/io/hdf5.h:147:
error: ‘space_id’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:147: error: ‘dims_out’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:147: error:
there are no arguments to ‘H5Sget_simple_extent_dims’ that depend on a
template parameter, so a declaration of ‘H5Sget_simple_extent_dims’
must be available /usr/local/include/flann/io/hdf5.h:151: error:
‘status’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:151: error: ‘get_hdf5_type’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:151: error:
expected primary-expression before ‘>’ token
/usr/local/include/flann/io/hdf5.h:151: error: expected
primary-expression before ‘)’ token
/usr/local/include/flann/io/hdf5.h:151: error: ‘H5S_ALL’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:151: error:
‘H5P_DEFAULT’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:154: error: there are no arguments
to ‘H5Sclose’ that depend on a template parameter, so a declaration of
‘H5Sclose’ must be available /usr/local/include/flann/io/hdf5.h:155:
error: there are no arguments to ‘H5Dclose’ that depend on a template
parameter, so a declaration of ‘H5Dclose’ must be available
/usr/local/include/flann/io/hdf5.h:156: error: there are no arguments
to ‘H5Fclose’ that depend on a template parameter, so a declaration of
‘H5Fclose’ must be available /usr/local/include/flann/io/hdf5.h: In
function ‘void flann::load_from_file(flann::Matrix&, const
std::string&, const std::string&) [with T = float]’:
../src/test1.cpp:15: instantiated from here
/usr/local/include/flann/io/hdf5.h:140: error: ‘H5Dopen’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:147: error:
‘H5Sget_simple_extent_dims’ was not declared in this scope
../src/test1.cpp:15: instantiated from here
/usr/local/include/flann/io/hdf5.h:151: error: ‘H5Dread’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:147: error:
‘H5Sclose’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:140: error: ‘H5Dclose’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:140: error:
‘H5Fclose’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h: In function ‘void
flann::save_to_file(const flann::Matrix&, const std::string&, const
std::string&) [with T = int]’: ../src/test1.cpp:28: instantiated
from here /usr/local/include/flann/io/hdf5.h:84: error: ‘H5Eset_auto’
was not declared in this scope /usr/local/include/flann/io/hdf5.h:89:
error: ‘H5Fopen’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:89: error: ‘H5Fcreate’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:89: error:
‘H5Dcreate’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:89: error: ‘H5Dopen’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:89: error:
‘H5Dwrite’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:118: error: ‘H5Sclose’ was not
declared in this scope /usr/local/include/flann/io/hdf5.h:106: error:
‘H5Dclose’ was not declared in this scope
/usr/local/include/flann/io/hdf5.h:89: error: ‘H5Fclose’ was not
declared in this scope make: * [src/test1.o] Error 1
I tried to compile flann but I got some errors when opened hdf5.h file about founding the hdf5.h! when open this file you can found import himself into code! "#include " How this happened?! And how can i fix this?
In file included from src/CBIR.cpp:9:
./flann/io/hdf5.h:33:18: error: hdf5.h: No such file or directory
In file included from src/CBIR.cpp:9:
./flann/io/hdf5.h:43: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:48: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:49: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:50: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:51: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:52: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:53: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:54: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:55: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:56: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:57: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h:58: error: expected constructor, destructor, or type conversion before 'get_hdf5_type'
./flann/io/hdf5.h: In function 'void flann::save_to_file(const flann::Matrix<T>&, const std::string&, const std::string&)':
./flann/io/hdf5.h:67: error: 'herr_t' was not declared in this scope
./flann/io/hdf5.h:67: error: expected `;' before 'status'
./flann/io/hdf5.h:68: error: 'hid_t' was not declared in this scope
./flann/io/hdf5.h:68: error: expected `;' before 'file_id'
./flann/io/hdf5.h:69: error: 'file_id' was not declared in this scope
./flann/io/hdf5.h:71: error: 'hsize_t' was not declared in this scope
./flann/io/hdf5.h:71: error: expected `;' before 'dimsf'
./flann/io/hdf5.h:72: error: 'dimsf' was not declared in this scope
./flann/io/hdf5.h:75: error: expected `;' before 'space_id'
./flann/io/hdf5.h:76: error: expected `;' before 'memspace_id'
./flann/io/hdf5.h:78: error: expected `;' before 'dataset_id'
./flann/io/hdf5.h:79: error: 'dataset_id' was not declared in this scope
./flann/io/hdf5.h:81: error: 'status' was not declared in this scope
./flann/io/hdf5.h:81: error: 'dataset_id' was not declared in this scope
./flann/io/hdf5.h:81: error: 'get_hdf5_type' was not declared in this scope
./flann/io/hdf5.h:81: error: expected primary-expression before '>' token
./flann/io/hdf5.h:81: error: expected primary-expression before ')' token
./flann/io/hdf5.h:81: error: 'memspace_id' was not declared in this scope
./flann/io/hdf5.h:81: error: 'space_id' was not declared in this scope
./flann/io/hdf5.h:81: error: 'H5P_DEFAULT' was not declared in this scope
./flann/io/hdf5.h:84: error: there are no arguments to 'H5Sclose' that depend on a template parameter, so a declaration of 'H5Sclose' must be available
./flann/io/hdf5.h:84: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
./flann/io/hdf5.h:85: error: there are no arguments to 'H5Sclose' that depend on a template parameter, so a declaration of 'H5Sclose' must be available
./flann/io/hdf5.h:86: error: there are no arguments to 'H5Dclose' that depend on a template parameter, so a declaration of 'H5Dclose' must be available
./flann/io/hdf5.h:87: error: 'file_id' was not declared in this scope
./flann/io/hdf5.h:87: error: there are no arguments to 'H5Fclose' that depend on a template parameter, so a declaration of 'H5Fclose' must be available
./flann/io/hdf5.h: In function 'void flann::load_from_file(flann::Matrix<T>&, const std::string&, const std::string&)':
./flann/io/hdf5.h:95: error: 'herr_t' was not declared in this scope
./flann/io/hdf5.h:95: error: expected `;' before 'status'
./flann/io/hdf5.h:96: error: 'hid_t' was not declared in this scope
./flann/io/hdf5.h:96: error: expected `;' before 'file_id'
./flann/io/hdf5.h:97: error: 'file_id' was not declared in this scope
./flann/io/hdf5.h:99: error: expected `;' before 'dataset_id'
./flann/io/hdf5.h:100: error: 'dataset_id' was not declared in this scope
./flann/io/hdf5.h:102: error: expected `;' before 'space_id'
./flann/io/hdf5.h:104: error: 'hsize_t' was not declared in this scope
./flann/io/hdf5.h:104: error: expected `;' before 'dims_out'
./flann/io/hdf5.h:105: error: 'space_id' was not declared in this scope
./flann/io/hdf5.h:105: error: 'dims_out' was not declared in this scope
./flann/io/hdf5.h:105: error: there are no arguments to 'H5Sget_simple_extent_dims' that depend on a template parameter, so a declaration of 'H5Sget_simple_extent_dims' must be available
./flann/io/hdf5.h:109: error: 'status' was not declared in this scope
./flann/io/hdf5.h:109: error: 'dataset_id' was not declared in this scope
./flann/io/hdf5.h:109: error: 'get_hdf5_type' was not declared in this scope
./flann/io/hdf5.h:109: error: expected primary-expression before '>' token
./flann/io/hdf5.h:109: error: expected primary-expression before ')' token
./flann/io/hdf5.h:109: error: 'H5S_ALL' was not declared in this scope
./flann/io/hdf5.h:109: error: 'H5P_DEFAULT' was not declared in this scope
./flann/io/hdf5.h:112: error: there are no arguments to 'H5Sclose' that depend on a template parameter, so a declaration of 'H5Sclose' must be available
./flann/io/hdf5.h:113: error: there are no arguments to 'H5Dclose' that depend on a template parameter, so a declaration of 'H5Dclose' must be available
./flann/io/hdf5.h:114: error: 'file_id' was not declared in this scope
./flann/io/hdf5.h:114: error: there are no arguments to 'H5Fclose' that depend on a template parameter, so a declaration of 'H5Fclose' must be available
./flann/io/hdf5.h: In function 'void flann::save_to_file(const flann::Matrix<T>&, const std::string&, const std::string&) [with T = float]':src/CBIR.cpp:62: instantiated from here
./flann/io/hdf5.h:81: error: 'H5Dwrite' was not declared in this scope
./flann/io/hdf5.h:81: error: 'H5Sclose' was not declared in this scope
./flann/io/hdf5.h:81: error: 'H5Dclose' was not declared in this scope
./flann/io/hdf5.h:87: error: 'H5Fclose' was not declared in this scope
./flann/io/hdf5.h: In function 'void flann::load_from_file(flann::Matrix<T>&, const std::string&, const std::string&) [with T = float]':
src/CBIR.cpp:83: instantiated from here
./flann/io/hdf5.h:105: error: 'H5Sget_simple_extent_dims' was not declared in this scope
src/CBIR.cpp:83: instantiated from here
./flann/io/hdf5.h:109: error: 'H5Dread' was not declared in this scope
./flann/io/hdf5.h:105: error: 'H5Sclose' was not declared in this scope
./flann/io/hdf5.h:109: error: 'H5Dclose' was not declared in this scope
./flann/io/hdf5.h:114: error: 'H5Fclose' was not declared in this scope
Makefile:43: recipe for target `src/CBIR.o' failed
make: *** [src/CBIR.o] Error 1
Here is hdf5.h link:
hdf5.h
This line
#include <hdf5.h>
does not refer to the file ifself but to another file with the same name expected to be located typically under /usr/include or whatever your compiler's default path for include files is.
However you seem to be missing the hdf5 library developer files, which should include /usr/include/hdf5.h
You might either find them here: http://www.hdfgroup.org/downloads/index.html or in the repository of your OS distribution.
I had installed libflann-dev and was trying to compile the sample program given at FLANN Manual, I faced the same problem.
hdf5.h header is available under different development package variations (in Ubuntu) namely libhdf5-dev, libhdf5-mpich-dev, libhdf5-openmpi-dev, libhdf5-mpi-dev etc, but they are put under their respective include directories as
/usr/include/hdf5/openmpi/hdf5.h
/usr/include/hdf5/mpich/hdf5.h
/usr/include/hdf5/serial/hdf5.h
So, while compiling if the relevant base path is provided as -I /usr/include/hdf5/serial/ the compilation goes well. Given I had chosen the serial version of hdf5, I had to use the respective library file libhdf5_serial. So, the compilation command becomes:
g++ flann_example.cpp -I /usr/include/hdf5/serial/ -lhdf5_serial
Alternately, one may create a soft link at /usr/include/hdf5.h pointing to /usr/include/hdf5/serial/hdf5.h.
The following error occurs whenever I try to run a simple application to grab frames from the camera of a Macbook Pro 13" (built-in iSight):
QTKit didn't find any attached Video Input Devices!
Warning, camera failed to properly initialize!
Cleaned up camera.
I've tried passing -1, 0 and as parameters to cvCreateCameraCapture() and the cv::VideoCapture object but none worked. It's important to say that I used OpenCV 2.3.1 on this machine for quite a while and it worked fine passing -1 as parameter.
This problem seems to happen with OpenCV v2.4.2 and v2.4.3 on Mac OS X 10.7.5.
Any ideas?
EDIT:
After a little bit of research I found that QTKit is the QuickTime Kit and has nothing to do with Qt. So the next logical thing to do was to disable QTKit from the OpenCV build, and the way to do that is through the flag -DWITH_QUICKTIME=YES, which forces OpenCV to be build with QuickTime for Video I/O instead of QTKit.
Unfortunately this solution didn't work either, since it caused several compiling errors that I don't want to deal with:
[ 32%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qt.cpp.o
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:75: error: ‘Movie’ does not name a type
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘CvCapture_QT_Movie* icvCaptureFromFile_QT(const char*)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:100: warning: declaration of ‘did_enter_movies’ shadows a global declaration [-Wshadow]
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:67: warning: shadowed declaration is here [-Wshadow]
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:103: error: ‘EnterMovies’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘int icvOpenFile_QT_Movie(CvCapture_QT_Movie*, const char*)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:142: error: ‘ClearMoviesStickyError’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:145: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:161: error: ‘kQTPOSIXPathStyle’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:161: error: ‘QTNewDataReferenceFromFullPathCFString’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:169: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:169: error: ‘newMovieActive’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:169: error: ‘newMovieAsyncOK’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:170: error: ‘NewMovieFromDataRef’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:190: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:190: error: ‘nextTimeMediaSample’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:190: error: ‘nextTimeEdgeOK’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:191: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:205: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:212: error: ‘GetMoviesError’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:213: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:213: error: ‘GetMovieBox’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:218: error: ‘QTNewGWorld’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:220: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:220: error: ‘SetMovieGWorld’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘int icvClose_QT_Movie(CvCapture_QT_Movie*)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:243: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:247: error: ‘DisposeGWorld’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:248: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:248: error: ‘DisposeMovie’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘double icvGetProperty_QT_Movie(CvCapture_QT_Movie*, int)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:264: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:281: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:281: error: ‘GetMovieTimeScale’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:286: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:286: error: ‘GetMovieDuration’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:300: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:300: error: ‘GetMovieDuration’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:301: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:301: error: ‘GetMovieTimeScale’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘int icvSetProperty_QT_Movie(CvCapture_QT_Movie*, int, double)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:331: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:351: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:351: error: ‘GetMovieTimeScale’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:356: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:356: error: ‘GetMovieDuration’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:370: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:370: error: ‘nextTimeStep’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:371: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:372: error: ‘GetMoviesError’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:385: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:385: error: ‘nextTimeStep’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:386: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:387: error: ‘GetMoviesError’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:408: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:408: error: ‘nextTimeStep’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:409: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:410: error: ‘GetMoviesError’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘int icvGrabFrame_QT_Movie(CvCapture_QT_Movie*)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:441: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:449: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:449: error: ‘SetMovieTimeValue’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:450: error: ‘GetMoviesError’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:458: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:458: error: ‘GetMovieTime’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:462: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:462: error: ‘nextTimeStep’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:462: error: ‘GetMovieNextInterestingTime’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘const void* icvRetrieveFrame_QT_Movie(CvCapture_QT_Movie*, int)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:484: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:494: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:494: error: ‘UpdateMovie’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:495: error: ‘GetMoviesError’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:503: error: ‘struct CvCapture_QT_Movie’ has no member named ‘myMovie’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:503: error: ‘MoviesTask’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:515: error: ‘GetGWorldPixMap’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:516: error: ‘LockPixels’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:517: error: ‘GetPixBaseAddr’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:517: error: ‘GetPixRowBytes’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:523: error: ‘UnlockPixels’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: At global scope:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:556: error: ‘SeqGrabComponent’ does not name a type
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:557: error: ‘SGChannel’ does not name a type
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:560: error: ‘ImageSequence’ does not name a type
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: In function ‘CvCapture_QT_Cam* icvCaptureFromCam_QT(int)’:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:590: error: ‘EnterMovies’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp: At global scope:
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:609: warning: unused parameter ‘capture’ [-Wunused-parameter]
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:609: warning: unused parameter ‘property_id’ [-Wunused-parameter]
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:616: warning: unused parameter ‘capture’ [-Wunused-parameter]
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:616: warning: unused parameter ‘property_id’ [-Wunused-parameter]
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:616: warning: unused parameter ‘value’ [-Wunused-parameter]
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: ‘SGChannel’ was not declared in this scope
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: expected primary-expression before ‘raw_data’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: expected primary-expression before ‘long’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: expected primary-expression before ‘long’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: expected primary-expression before ‘long’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: expected primary-expression before ‘,’ token
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: expected primary-expression before ‘short’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: expected primary-expression before ‘long’
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: error: initializer expression list treated as compound expression
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:854: error: expected ‘,’ or ‘;’ before ‘{’ token
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:238: warning: ‘int icvClose_QT_Movie(CvCapture_QT_Movie*)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:261: warning: ‘double icvGetProperty_QT_Movie(CvCapture_QT_Movie*, int)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:328: warning: ‘int icvSetProperty_QT_Movie(CvCapture_QT_Movie*, int, double)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:438: warning: ‘int icvGrabFrame_QT_Movie(CvCapture_QT_Movie*)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:481: warning: ‘const void* icvRetrieveFrame_QT_Movie(CvCapture_QT_Movie*, int)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:98: warning: ‘CvCapture_QT_Movie* icvCaptureFromFile_QT(const char*)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:572: warning: ‘int icvOpenCamera_QT(CvCapture_QT_Cam*, int)’ declared ‘static’ but never defined
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:573: warning: ‘int icvClose_QT_Cam(CvCapture_QT_Cam*)’ declared ‘static’ but never defined
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:609: warning: ‘double icvGetProperty_QT_Cam(CvCapture_QT_Cam*, int)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:616: warning: ‘int icvSetProperty_QT_Cam(CvCapture_QT_Cam*, int, double)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:576: warning: ‘int icvGrabFrame_QT_Cam(CvCapture_QT_Cam*)’ declared ‘static’ but never defined
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:577: warning: ‘const void* icvRetrieveFrame_QT_Cam(CvCapture_QT_Cam*, int)’ declared ‘static’ but never defined
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:586: warning: ‘CvCapture_QT_Cam* icvCaptureFromCam_QT(int)’ defined but not used
/OpenCV-2.4.3/modules/highgui/src/cap_qt.cpp:853: warning: ‘icvDataProc_QT_Cam’ defined but not used
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_qt.cpp.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
I reported this problem but now I think it might be specific to my system, I'll try to perform more tests to clear it up.
Anyway, here's what I had to to fix the issue:
Edit modules/highgui/src/cap_qtkit.mm and jump to line 313 to see the implementation of:
int CvCaptureCAM::startCaptureDevice(int cameraNum) {
Our changes will be made to this method, so locate the following block:
if (cameraNum >= 0) {
int nCameras = [devices count];
if( cameraNum < 0 || cameraNum >= nCameras )
return 0;
device = [devices objectAtIndex:cameraNum] ;
} else {
device = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeVideo] ;
}
and replace it by:
if (cameraNum >= 0) {
int nCameras = [devices count];
if( cameraNum > nCameras )
return 0;
cameraNum--;
device = [devices objectAtIndex:cameraNum] ;
} else {
device = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeVideo] ;
}
Recompile OpenCV and don't forget to install it on your system again.
Just restart the camera solved the problem.
sudo killall VDCAssistant
I had the same problem and I did not find any solution. By trial and error, I found that my OpenCV version is corrupted. As a result, I deleted it and install a new fresh one. You can use one of these two options:
1. Terminal
run brew uninstall opencv3 to uninstall opencv
then install it using sudo apt-get install libopencv-dev python-opencv command.
2. Anaconda
Actually, I used this method for my own problem.
open anaconda
go to the environment section and select your environment as follow:
then click on installed and search for opencv:
select opencv package and uninstall it. then try to re-install opencv by selecting not installed and searching for opencv. be careful to install the correct version.
Currently I'm learning C++ in my book and they had an exercise on using a previously created class called IntList and implement it using IntListProxy. My book only talks about proxies in a very simple example so I'm having a hard time with the syntax of it. What am I doing wrong with this proxy and how can I fix it? Keep in mind IntList is already a .o and I'm not allowed to include IntList.cpp when I compile this.
The error:
IntListProxy.cpp: In member function ‘bool IntListProxy::isEmpty()’:
IntListProxy.cpp:7: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp: In member function ‘IntListProxy* IntListProxy::prepend(int)’:
IntListProxy.cpp:13: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp: In member function ‘int IntListProxy::head()’:
IntListProxy.cpp:19: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp: In member function ‘IntListProxy* IntListProxy::tail()’:
IntListProxy.cpp:25: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp: In member function ‘std::string IntListProxy::toString()’:
IntListProxy.cpp:31: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp: In member function ‘int IntListProxy::length()’:
IntListProxy.cpp:37: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp: In member function ‘IntListProxy* `IntListProxy::append(IntListProxy*)’:`
IntListProxy.cpp:43: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp: In member function ‘int IntListProxy::operator[](int)’:
IntListProxy.cpp:49: error: invalid use of incomplete type ‘struct IntList’
IntListProxy.h:5: error: forward declaration of ‘struct IntList’
IntListProxy.cpp:51: error: expected unqualified-id before ‘}’ token
IntListProxy.cpp:51: error: expected ‘;’ before ‘}’ token
IntListProxy.h
#include <iostream>
#include <string>
using namespace std;
class IntList;
class IntListProxy
{
public:
IntListProxy();
bool isEmpty();
IntListProxy *prepend(int n);
int head();
IntListProxy *tail();
string toString();
int length();
IntListProxy *append(IntListProxy *lst);
int operator[](int n);
private:
IntList *ptr;
};
IntListProxy.cpp
#include "IntListProxy.h"
IntListProxy::IntListProxy(){}
bool IntListProxy::isEmpty(){
ptr->isEmpty();
}
IntListProxy *IntListProxy::prepend(int n){
return ptr->prepend(n);
}
int IntListProxy::head(){
return ptr->head();
}
IntListProxy *IntListProxy::tail(){
return ptr->tail();
}
string IntListProxy::toString(){
return ptr->toString();
}
int IntListProxy::length(){
return ptr->length();
}
IntListProxy *IntListProxy::append(IntListProxy *lst){
return ptr->append(lst);
}
int IntListProxy::operator[](int n){
return ptr->operator[](n);
}
Thank you in advance!
Suggested Solution:
You need to include the header file which defines class IntList in your cpp file IntListProxy.cpp.
Explanation:
When instead of including the header file you add the line:
class IntList;
It Forward declares the class IntList which means for compiler it is an Incomplete type. With Incomplete types, One cannot create objects of it or do anything which needs the compiler to know the layout of IntList or more than the fact that IntList is just an type. i.e: The compiler does not know what are its members and what its memory layout is.
But Since pointers to all objects need just the same memory allocation, You can use the forward declaration when just reffering to an Incomplete type as a pointer.
In this case your cpp file IntListProxy.cpp needs to know the layout(members) of IntList to be able to dereference it and hence the error.
At line 7, where you call isEmpty, IntList has only been forward-declared. The compiler has not yet seen the actual definition of the class.
You have just forward declared IntList. Compiler doesn't know which methods exists in this struct. Hence you need to include the header file which contains the definition of IntList in the proxy cpp file.