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.
Related
While upgrading OpenSSL from .97e to 1.0.2d I'm facing these errors,
BasicAuthCertificateLoader.cpp: At global scope:
BasicAuthCertificateLoader.cpp:493: error:
X509*CBasicAuthCertificateLoader::GetCert' is not a static member of
class CBasicAuthCertificateLoader'
BasicAuthCertificateLoader.cpp:493: error: LHASH' was not declared in
this scope BasicAuthCertificateLoader.cpp:493: error:conf' was not
declared in this scope BasicAuthCertificateLoader.cpp:493: error:
expected primary-expression before '' token
BasicAuthCertificateLoader.cpp:493: error: req' was not declared in
this scope BasicAuthCertificateLoader.cpp:493: error: expected
primary-expression before '*' token
BasicAuthCertificateLoader.cpp:493: error:issuer' was not declared
in this scope BasicAuthCertificateLoader.cpp:493: error: expected
primary-expression before '' token
BasicAuthCertificateLoader.cpp:493: error: priv_key' was not declared
in this scope BasicAuthCertificateLoader.cpp:493: error: expected
primary-expression before "days" BasicAuthCertificateLoader.cpp:494:
error: initializer expression list treated as compound expression
BasicAuthCertificateLoader.cpp:494: error: expected,' or ;' before
'{' token BasicAuthCertificateLoader.cpp: In member functionHRESULT
CBasicAuthCertificateLoader::GenerateCertificateData(char*, X509**,
EVP_PKEY**, PKCS12**)': BasicAuthCertificateLoader.cpp:651: error:
LHASH' was not declared in this scope
BasicAuthCertificateLoader.cpp:651: error:conf' was not declared in
this scope BasicAuthCertificateLoader.cpp:674: warning: cast from
const char*' tovoid*' discards qualifiers from pointer target type
BasicAuthCertificateLoader.cpp:691: error: GetCert' was not declared
in this scope BasicAuthCertificateLoader.cpp:705: error:GetCert' was
not declared in this scope
Has any one faced similar errors?
error: `LHASH' was not declared in this scope...
Ensure the source file in question includes lhash.h:
#include <openssl/lhash.h>
Also see the lhash(3) man page.
If you are already including lhash.h, then your project is probably not set up correctly.
You should clear this error first since its the first one listed. These errors have a way of chaining themselves:
At global scope: BasicAuthCertificateLoader.cpp:493:
error: X509* CBasicAuthCertificateLoader::GetCert' is not a static member
of class CBasicAuthCertificateLoader'
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
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.
im trying to compile PyGAMMA according to these instructions http://scion.duhs.duke.edu/vespa/gamma/wiki/PyGammaBuildingLibrary:
My setup:
XCode: 4.5.1 + CommandLineTools
MacOSX Lion
I get the following output:
~/gamma/platforms/OSX $ make pysgdist
Include directory: /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
Library directory: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Checking for python include and lib directories
Good. The Python Includes Directory Exists. /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
Good. The Python Library Directory Exists. /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
g++ -c -fPIC -Wall -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk -I../../src -D_USING_LAPACK_ -O3 -arch x86_64 ../../src/Basics/Gutils.cc -o ../../mac-darwin/Gutils.pso
In file included from ../../src/Basics/Gutils.cc:33:
../../src/Basics/Gutils.h:33:50: error: string: No such file or directory
../../src/Basics/Gutils.h:34:60: error: iostream: No such file or directory
In file included from ../../src/Basics/Gutils.h:35,
from ../../src/Basics/Gutils.cc:33:
../../src/GamGen.h:163:19: error: cstdlib: No such file or directory
../../src/Basics/Gutils.cc:37:20: error: stdlib.h: No such file or directory
../../src/Basics/Gutils.cc:38:18: error: math.h: No such file or directory
In file included from ../../src/Basics/Gutils.cc:33:
../../src/Basics/Gutils.h:52: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:52: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:54: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:54: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:56: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:56: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:58: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:58: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:59: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:59: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:60: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:60: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:77: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:77: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:78: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:78: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.h:79: error: expected unqualified-id before ‘&’ token
../../src/Basics/Gutils.h:79: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:40: error: ‘std::string’ has not been declared
../../src/Basics/Gutils.cc:41: error: ‘std::cout’ has not been declared
../../src/Basics/Gutils.cc:42: error: ‘std::cin’ has not been declared
../../src/Basics/Gutils.cc:43: error: ‘std::endl’ has not been declared
../../src/Basics/Gutils.cc:61: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:61: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘void query_parameter(int, char**, int, int)’:
../../src/Basics/Gutils.cc:63: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:64: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:64: error: ‘Q’ was not declared in this scope
../../src/Basics/Gutils.cc:64: error: ‘cin’ was not declared in this scope
../../src/Basics/Gutils.cc:64: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:68: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:68: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘void query_parameter(int, char**, int, int)’:
../../src/Basics/Gutils.cc:68: error: redefinition of ‘void query_parameter(int, char**, int, int)’
../../src/Basics/Gutils.cc:61: error: ‘void query_parameter(int, char**, int, int)’ previously defined here
../../src/Basics/Gutils.cc:70: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:70: error: ‘atof’ was not declared in this scope
../../src/Basics/Gutils.cc:71: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:71: error: ‘Q’ was not declared in this scope
../../src/Basics/Gutils.cc:71: error: ‘cin’ was not declared in this scope
../../src/Basics/Gutils.cc:71: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:75: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:75: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘void query_parameter(int, char**, int, int)’:
../../src/Basics/Gutils.cc:75: error: redefinition of ‘void query_parameter(int, char**, int, int)’
../../src/Basics/Gutils.cc:61: error: ‘void query_parameter(int, char**, int, int)’ previously defined here
../../src/Basics/Gutils.cc:77: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:77: error: ‘atoi’ was not declared in this scope
../../src/Basics/Gutils.cc:78: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:78: error: ‘Q’ was not declared in this scope
../../src/Basics/Gutils.cc:78: error: ‘cin’ was not declared in this scope
../../src/Basics/Gutils.cc:78: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:82: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:82: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘bool ask_set(int, char**, int, int)’:
../../src/Basics/Gutils.cc:85: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:85: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:89: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:89: error: ‘Q’ was not declared in this scope
../../src/Basics/Gutils.cc:90: error: ‘cin’ was not declared in this scope
../../src/Basics/Gutils.cc:91: error: expected `;' before ‘ss’
../../src/Basics/Gutils.cc:91: warning: statement has no effect
../../src/Basics/Gutils.cc:92: error: ‘ss’ was not declared in this scope
../../src/Basics/Gutils.cc:93: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:98: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:98: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘bool ask_set(int, char**, int, int)’:
../../src/Basics/Gutils.cc:98: error: redefinition of ‘bool ask_set(int, char**, int, int)’
../../src/Basics/Gutils.cc:82: error: ‘bool ask_set(int, char**, int, int)’ previously defined here
../../src/Basics/Gutils.cc:101: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:101: error: ‘atoi’ was not declared in this scope
../../src/Basics/Gutils.cc:105: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:105: error: ‘Q’ was not declared in this scope
../../src/Basics/Gutils.cc:106: error: ‘cin’ was not declared in this scope
../../src/Basics/Gutils.cc:107: error: expected `;' before ‘ss’
../../src/Basics/Gutils.cc:107: warning: statement has no effect
../../src/Basics/Gutils.cc:108: error: ‘ss’ was not declared in this scope
../../src/Basics/Gutils.cc:109: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:109: error: ‘atoi’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:114: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:114: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘bool ask_set(int, char**, int, int)’:
../../src/Basics/Gutils.cc:114: error: redefinition of ‘bool ask_set(int, char**, int, int)’
../../src/Basics/Gutils.cc:82: error: ‘bool ask_set(int, char**, int, int)’ previously defined here
../../src/Basics/Gutils.cc:117: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:117: error: ‘atof’ was not declared in this scope
../../src/Basics/Gutils.cc:121: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:121: error: ‘Q’ was not declared in this scope
../../src/Basics/Gutils.cc:122: error: ‘cin’ was not declared in this scope
../../src/Basics/Gutils.cc:123: error: expected `;' before ‘ss’
../../src/Basics/Gutils.cc:123: warning: statement has no effect
../../src/Basics/Gutils.cc:124: error: ‘ss’ was not declared in this scope
../../src/Basics/Gutils.cc:125: error: ‘V’ was not declared in this scope
../../src/Basics/Gutils.cc:125: error: ‘atof’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:143: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:143: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘void GAMMAerror(int)’:
../../src/Basics/Gutils.cc:154: error: expected `;' before ‘s’
../../src/Basics/Gutils.cc:154: warning: statement has no effect
../../src/Basics/Gutils.cc:155: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:155: error: ‘s’ was not declared in this scope
../../src/Basics/Gutils.cc:155: error: ‘noret’ was not declared in this scope
../../src/Basics/Gutils.cc:155: error: ‘endl’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:158: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:158: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘void GAMMAerror(int)’:
../../src/Basics/Gutils.cc:158: error: redefinition of ‘void GAMMAerror(int)’
../../src/Basics/Gutils.cc:143: error: ‘void GAMMAerror(int)’ previously defined here
../../src/Basics/Gutils.cc:160: error: expected `;' before ‘msg’
../../src/Basics/Gutils.cc:160: warning: statement has no effect
../../src/Basics/Gutils.cc:161: error: ‘eidx’ was not declared in this scope
../../src/Basics/Gutils.cc:163: error: ‘msg’ was not declared in this scope
../../src/Basics/Gutils.cc:163: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:164: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:165: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:166: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:167: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:168: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:169: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:170: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:171: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:172: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:173: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:174: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:175: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:176: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:177: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:178: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:179: error: ‘noret’ was not declared in this scope
../../src/Basics/Gutils.cc:179: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:181: error: ‘hdr’ was not declared in this scope
../../src/Basics/Gutils.cc:181: error: ‘msg’ was not declared in this scope
../../src/Basics/Gutils.cc:181: error: ‘noret’ was not declared in this scope
../../src/Basics/Gutils.cc: At global scope:
../../src/Basics/Gutils.cc:184: error: expected ‘,’ or ‘...’ before ‘&’ token
../../src/Basics/Gutils.cc:184: error: ISO C++ forbids declaration of ‘string’ with no type
../../src/Basics/Gutils.cc: In function ‘void GAMMAerror(int)’:
../../src/Basics/Gutils.cc:184: error: redefinition of ‘void GAMMAerror(int)’
../../src/Basics/Gutils.cc:143: error: ‘void GAMMAerror(int)’ previously defined here
../../src/Basics/Gutils.cc:186: error: expected `;' before ‘msg’
../../src/Basics/Gutils.cc:186: warning: statement has no effect
../../src/Basics/Gutils.cc:187: error: ‘eidx’ was not declared in this scope
../../src/Basics/Gutils.cc:189: error: ‘msg’ was not declared in this scope
../../src/Basics/Gutils.cc:189: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:190: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:191: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:192: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:193: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:194: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:195: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:195: error: ‘pname’ was not declared in this scope
../../src/Basics/Gutils.cc:196: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:197: error: ‘string’ cannot be used as a function
../../src/Basics/Gutils.cc:199: error: ‘hdr’ was not declared in this scope
../../src/Basics/Gutils.cc:199: error: ‘msg’ was not declared in this scope
../../src/Basics/Gutils.cc:199: error: ‘pname’ was not declared in this scope
../../src/Basics/Gutils.cc:199: error: ‘noret’ was not declared in this scope
../../src/Basics/Gutils.cc: In function ‘volatile void GAMMAfatal()’:
../../src/Basics/Gutils.cc:204: error: ‘cout’ was not declared in this scope
../../src/Basics/Gutils.cc:204: error: ‘endl’ was not declared in this scope
../../src/Basics/Gutils.cc:205: error: ‘exit’ was not declared in this scope
make: *** [../../mac-darwin/Gutils.pso] Error 1
It seems that the standard C++ includes are not automatically included.
Does somebody have a hunch on how to fix this?
Thanks.
Just solved it..
1) Tell gcc about the usual C++ standard header. Therefore change:
SRCDIRINCL = -I$(SRCDIR)
to
SRCDIRINCL = -I$(SRCDIR) -I/usr/include -I/usr/include/c++/4.2.1/
2) Tell gcc about the usual osx framework path and include the Accelerate framework. Therefore change:
LAPACK_LIBS =
to
LAPACK_LIBS = -F/System/Library/Frameworks/ -framework Accelerate
Should work fine now.
I've always used MinGW or Dev-C++ to write code in C++ on Microsoft Windows, but now I have to use Code Blocks.
I've downloaded it and installed it, with the standard procedure.
I've tried to run the supersimple HelloWorld.cpp example file, but I got many compiling errors:
#include <iostream>
using namespace std;
int main()
{
cout << “Hello World!” << endl;
}
Here's the list of my compiler errors:
Compiling: C:\Temp7\provaC\test00.cpp
In file included from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:49,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h:42,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ios:44,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:45,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iostream:45,
from C:\Temp7\provaC\test00.cpp:1:
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstddef:52: error: `::ptrdiff_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstddef:53: error: `::size_t' has not been declared
In file included from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:51,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h:42,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ios:44,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:45,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iostream:45,
from C:\Temp7\provaC\test00.cpp:1:
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:36: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:37: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:38: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:39: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:40: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:46: error: expected constructor, destructor, or type conversion before "strcspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:46: error: expected `,' or `;' before "strcspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:49: error: expected constructor, destructor, or type conversion before "strlen"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:49: error: expected `,' or `;' before "strlen"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:50: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:51: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:52: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:55: error: expected constructor, destructor, or type conversion before "strspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:55: error: expected `,' or `;' before "strspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:58: error: expected constructor, destructor, or type conversion before "strxfrm"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:58: error: expected `,' or `;' before "strxfrm"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:65: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:66: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:72: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:73: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:77: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:80: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:81: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:90: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:91: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:100: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:102: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:104: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:109: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:125: error: expected constructor, destructor, or type conversion before "wcscspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:125: error: expected `,' or `;' before "wcscspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:127: error: expected constructor, destructor, or type conversion before "wcslen"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:127: error: expected `,' or `;' before "wcslen"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:128: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:129: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:130: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:133: error: expected constructor, destructor, or type conversion before "wcsspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:133: error: expected `,' or `;' before "wcsspn"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:136: error: expected constructor, destructor, or type conversion before "wcsxfrm"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:136: error: expected `,' or `;' before "wcsxfrm"
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:150: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:151: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:157: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:158: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:175: error: `size_t' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:176: error: `size_t' has not been declared
In file included from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h:42,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ios:44,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:45,
from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iostream:45,
from C:\Temp7\provaC\test00.cpp:1:
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:89: error: `::strxfrm' has not been declared
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:90: error: `::strcspn' has not been declared
Process terminated with status 1 (0 minutes, 5 seconds)
It seems that in the standard libraries some structures are absent (ptr_diff_t, size_t, etc).
Could someone help me and let me compile my simple HelloWorld.cpp?
Thanks!
It's your quotation marks which are causing the problem:
See how “” is different from ""? That's why it is not compiling. They are not valid characters in C++.
You are using wrong quotation marks.. Change “ and ” to ""