I generated moc files for QT5 using
set (CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Then I add the moc files into SRC using
SET(SRC
src/main.cpp
src/video_widget_surface.cpp
src/video_widget.cpp
src/video_player.cpp
#moc files
moc/moc_video_player.cpp
moc/moc_video_widget.cpp
moc/moc_video_widget_surface.cpp
Finally I add the executable using
add_executable(somegui ${SRC})
But I get errors in moc files saying :
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:54:6: error: 'VideoWidget' has not been declared
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:62:19: error: 'VideoWidget' has not been declared
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:68:20: error: 'VideoWidget' has not been declared
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:68:46: error: non-member function 'const QMetaObject* metaObject()' cannot have cv-qualifier
/other/Qt5.0.1/5.0.1/gcc_64/include/QtCore/qobject.h: In function 'const QMetaObject* metaObject()':
/other/Qt5.0.1/5.0.1/gcc_64/include/QtCore/qobject.h:401:33: error: 'QScopedPointer<QObjectData> QObject::d_ptr' is protected
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:70:21: error: within this context
/other/Qt5.0.1/5.0.1/gcc_64/include/QtCore/qobject.h:401:33: error: invalid use of non-static data member 'QObject::d_ptr'
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:70:21: error: from this location
/other/Qt5.0.1/5.0.1/gcc_64/include/QtCore/qobject.h:401:33: error: 'QScopedPointer<QObjectData> QObject::d_ptr' is protected
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:70:50: error: within this context
/other/Qt5.0.1/5.0.1/gcc_64/include/QtCore/qobject.h:401:33: error: invalid use of non-static data member 'QObject::d_ptr'
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:70:50: error: from this location
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp: At global scope:
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:73:7: error: 'VideoWidget' has not been declared
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp: In function 'void* qt_metacast(const char*)':
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:77:47: error: expected type-specifier before 'VideoWidget'
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:77:47: error: expected '>' before 'VideoWidget'
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:77:47: error: expected '(' before 'VideoWidget'
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:77:47: error: 'VideoWidget' was not declared in this scope
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:77:59: error: expected primary-expression before '>' token
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:77:61: error: invalid use of 'this' in non-member function
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:77:67: error: expected ')' before ';' token
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:78:40: error: cannot call member function 'virtual void* QWidget::qt_metacast(const char*)' without object
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp: At global scope:
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:81:5: error: 'VideoWidget' has not been declared
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp: In function 'int qt_metacall(QMetaObject::Call, int, void**)':
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:83:43: error: cannot call member function 'virtual int QWidget::qt_metacall(QMetaObject::Call, int, void**)' without object
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp: In function 'void* qt_metacast(const char*)':
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:79:1: warning: control reaches end of non-void function [-Wreturn-type]
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp: In function 'const QMetaObject* metaObject()':
/other/workspace/perception/somestuff/moc/moc_video_widget.cpp:71:1: warning: control reaches end of non-void function [-Wreturn-type]
make[2]: *** [CMakeFiles/somestuff.dir/moc/moc_video_widget.cpp.o] Error 1
make[1]: *** [CMakeFiles/somestuff.dir/all] Error 2
make: *** [all] Error 2
My understanding is that there is some error in the moc files that are created. But I don't have any control over how that is created. Now how do I solve this bug ?
CMake documentation is not that bad, do not neglect reading it. You misunderstood the concept of AUTOMOC:
AUTOMOC is a boolean specifying whether CMake will handle the Qt moc preprocessor automatically, i.e. without having to use the QT4_WRAP_CPP() macro. Currently Qt4 is supported. When this property is set to TRUE, CMake will scan the source files at build time and invoke moc accordingly. If an #include statement like #include "moc_foo.cpp" is found, the Q_OBJECT class declaration is expected in the header, and moc is run on the header file. If an #include statement like #include "foo.moc" is found, then a Q_OBJECT is expected in the current source file and moc is run on the file itself. Additionally, all header files are parsed for Q_OBJECT macros, and if found, moc is also executed on those files.
So, first of all, you should not add generated moc files explicitly to sources and push them into executable compilation. In other words, you only push your sources:
SET(SRC
src/main.cpp
src/video_widget_surface.cpp
src/video_widget.cpp
src/video_player.cpp)
and moc ones are handled automatically by CMake.
Secondly, as stated in the documentation:
If Q_OBJECT is in the foo.h (i.e. QObject is declared in the header file),
then in the corresponding foo.cpp
don't forget to add #include "moc_foo.cpp", preferably at the end
of the file;
If Q_OBJECT is in the foo.cpp (i.e. QObject is declared in the source file),
then, again, in the foo.cpp itself
don't forget to add #include "foo.moc", preferably at the end
of the file.
Related
I am trying to build a docker from a fork and I am getting the following error when performing docker build ./:
cc1: all warnings being treated as errors
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0'
make: *** [install] Error 2
On install we run
apt-get -y install libpcre3-dev zlib1g-dev libssl-dev openssl build-essential wget
I can't find this error on google. The full error for reference as I can't find out the exact error reference I need to research:
src/event/ngx_event_openssl.c: In function 'ngx_ssl_init':
src/event/ngx_event_openssl.c:112:5: error: 'OPENSSL_config' is deprecated [-Werror=deprecated-declarations]
OPENSSL_config(NULL);
^~~~~~~~~~~~~~
In file included from /usr/include/openssl/ct.h:13:0,
from /usr/include/openssl/ssl.h:61,
from src/event/ngx_event_openssl.h:15,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/conf.h:92:1: note: declared here
DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
^
src/event/ngx_event_openssl.c: In function 'ngx_ssl_rsa512_key_callback':
src/event/ngx_event_openssl.c:753:9: error: 'RSA_generate_key' is deprecated [-Werror=deprecated-declarations]
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
^~~
In file included from /usr/include/openssl/rsa.h:13:0,
from /usr/include/openssl/x509.h:31,
from /usr/include/openssl/ssl.h:50,
from src/event/ngx_event_openssl.h:15,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/rsa.h:193:1: note: declared here
DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
^
src/event/ngx_event_openssl.c: In function 'ngx_ssl_dhparam':
src/event/ngx_event_openssl.c:943:11: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
^~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_handshake':
src/event/ngx_event_openssl.c:1164:31: error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}'
if (c->ssl->connection->s3) {
^~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_connection_error':
src/event/ngx_event_openssl.c:1913:21: error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function)
|| n == SSL_R_NO_CIPHERS_PASSED /* 182 */
^~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c:1913:21: note: each undeclared identifier is reported only once for each function it appears in
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_cache':
src/event/ngx_event_openssl.c:2107:43: error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type [-Werror=incompatible-pointer-types]
SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session);
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/event/ngx_event_openssl.h:15:0,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/ssl.h:637:6: note: expected 'SSL_SESSION * (*)(struct ssl_st *, const unsigned char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, const unsigned char *, int, int *)}' but argument is of type 'SSL_SESSION * (*)(SSL *, u_char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, unsigned char *, int, int *)}'
void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
^~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_id_context':
src/event/ngx_event_openssl.c:2129:27: error: storage size of 'md' isn't known
EVP_MD_CTX md;
^~
src/event/ngx_event_openssl.c:2195:5: error: implicit declaration of function 'EVP_MD_CTX_cleanup' [-Werror=implicit-function-declaration]
EVP_MD_CTX_cleanup(&md);
^~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_ticket_key_callback':
src/event/ngx_event_openssl.c:2864:9: error: 'RAND_pseudo_bytes' is deprecated [-Werror=deprecated-declarations]
RAND_pseudo_bytes(iv, 16);
^~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/engine.h:19:0,
from src/event/ngx_event_openssl.h:22,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/rand.h:47:1: note: declared here
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
^
cc1: all warnings being treated as errors
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0'
make: *** [install] Error 2
This is the docker fork I am running https://github.com/meteorhacks/mup-frontend-server
You are getting various errors and warnings here, but they aren't really about Docker or OpenSSL. If we strip away the extraneous information, here are the problems you are encountering.
error: 'OPENSSL_config' is deprecated
error: 'RSA_generate_key' is deprecated
error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}'
error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function)
error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type
error: storage size of 'md' isn't known
error: implicit declaration of function 'EVP_MD_CTX_cleanup'
error: 'RAND_pseudo_bytes' is deprecated
The core of the problem here is probably that you are using a legacy version of Nginx in this project. From the GitHub repository you pointed to, in install-nginx.sh:
NGINX_VERSION=1.8.0
The current mainline version of Nginx is 1.13.2. I haven't combed through the changelogs for Nginx, but based on the errors you are receiving, it seems likely that between the 1.8 releases and the current ones, OpenSSL has deprecated various functions that Nginx 1.8 relied on. Most likely this can be solved by moving to a recent release of Nginx.
As of this writing, 1.13.2 is the current mainline, and 1.12.0 is the current stable. One of those may work better. Whether you can simply drop this in, I can't say. You may have to change something in the build scripts or the nginx config for a more recent version to work properly.
you are getting this error because your nginx version don't support SSL 1.1.0. Either upgrade NGINX version or use SSL 1.0.2.
I am trying to compile Qt for static linking following this tutorial: http://qt-project.org/wiki/How-to-build-a-static-Qt-for-Windows-MinGW
But i receive tons of warnings and a few errors.
For example this one:
C:/Developement/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lqjp2
collect2.exe: error: ld returned 1 exit status
Makefile.Release:79: recipe for target '..\..\bin\dumpdoc.exe' failed
mingw32-make[4]: *** [..\..\bin\dumpdoc.exe] Error 1
mingw32-make[4]: Target 'first' not remade because of errors.
mingw32-make[4]: Leaving directory 'C:/Developement/Qt/Static/src/qt-everywhere-opensource-src-5.3.0/qtactiveqt/tools/dumpdoc'
Makefile:34: recipe for target 'release' failed
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Target 'first' not remade because of errors.
for this, i set the environement variable to my path:
Name: LIBRARY_PATH
Value: C:\Developement\Qt\5.3\mingw482_32\bin
... but dunno yet if its gonna workin'
Beside this, i put the following paths to the PATH environement variable:
C:\Developement\Qt\5.3\mingw482_32\bin;
C:\Developement\Qt\Tools\mingw482_32\bin;
I am receiving tons of these kind of warning:
In file included from
C:\Developement\Qt\Static\src\qt-everywhere-opensource-src-5.3.0\qtbase\src\3rdparty\libjpeg/jpeglib.h:25:0,
from ......\3rdparty\jasper\src\libjasper\jpg\jpg_jpeglib.h:74,
from ......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:75:
C:\Developement\Qt\Static\src\qt-everywhere-opensource-src-5.3.0\qtbase\src\3rdparty\libjpeg/jconfig.h:55:0:
warning: "HAVE_STDDEF_H" redefined [enabled by default] #define
HAVE_STDDEF_H ^ In file included from
......\3rdparty\jasper\src\libjasper\include/jasper/jas_tvp.h:75:0,
from ......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:70:
......\3rdparty\jasper\src\libjasper\include/jasper/jas_config.h:65:0:
note: this is the location of the previous definition #define
HAVE_STDDEF_H 1 ^ In file included from
C:\Developement\Qt\Static\src\qt-everywhere-opensource-src-5.3.0\qtbase\src\3rdparty\libjpeg/jpeglib.h:25:0,
from ......\3rdparty\jasper\src\libjasper\jpg\jpg_jpeglib.h:74,
from ......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:75:
C:\Developement\Qt\Static\src\qt-everywhere-opensource-src-5.3.0\qtbase\src\3rdparty\libjpeg/jconfig.h:59:0:
warning: "HAVE_STDLIB_H" redefined [enabled by default] #define
HAVE_STDLIB_H ^
In file included from ......\3rdparty\jasper\src\libjasper\include/jasper/jas_tvp.h:75:0,
from ......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:70:
......\3rdparty\jasper\src\libjasper\include/jasper/jas_config.h:71:0:
note: this is the location of the previous definition
#define HAVE_STDLIB_H 1
^
......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c: In function 'jpg_decode':
......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:134:49: warning: parameter 'optstr' set but not used
[-Wunused-but-set-parameter]
jas_image_t *jpg_decode(jas_stream_t *in, char *optstr)
^
......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c: In function 'jpg_start_output':
......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:298:47: warning: parameter 'cinfo' set but not used
[-Wunused-but-set-parameter]
static void jpg_start_output(j_decompress_ptr cinfo, jpg_dest_t *dinfo)
^
......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c: In function 'jpg_finish_output':
......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:335:48: warning: parameter 'cinfo' set but not used
[-Wunused-but-set-parameter]
static void jpg_finish_output(j_decompress_ptr cinfo, jpg_dest_t *dinfo)
^ ......\3rdparty\jasper\src\libjasper\jpg\jpg_dec.c:335:67: warning:
parameter 'dinfo' set but not used [-Wunused-but-set-parameter]
static void jpg_finish_output(j_decompress_ptr cinfo, jpg_dest_t *dinfo)
^
Wasn't i prepared enough to compile Qt?
What do i need to do in order to be able to compile Qt without getting errors everytime thrown out?
How long would it take until its compiled.
I'm testing my MPU6050 module with Arduino Mega. I found Jeff Rowberg has written a library for this. I tried with this example provided by him. But the Arduino IDE gives a large number of errors when trying to verify the sketch.
I've already installed Jeffs library. (following image shows the library content)
This is the error I'm getting:
In file included from C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:42,
from sketch_dec08a.cpp:50:
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050.h:792: warning: only initialized variables can be placed into program memory area
In file included from sketch_dec08a.cpp:50:
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:89: warning: only initialized variables can be placed into program memory area
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:89: error: conflicting declaration 'const prog_uchar dmpMemory [1929]'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050.h:792: error: 'dmpMemory' has a previous declaration as 'prog_uchar dmpMemory [1929]'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:229: warning: only initialized variables can be placed into program memory area
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:271: warning: only initialized variables can be placed into program memory area
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:271: error: conflicting declaration 'const prog_uchar dmpUpdates [47]'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050.h:931: error: 'dmpUpdates' has a previous declaration as 'uint8_t dmpUpdates [29][9]'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:281: error: no 'uint8_t MPU6050::dmpInitialize()' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:506: error: no 'bool MPU6050::dmpPacketAvailable()' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:533: error: no 'uint8_t MPU6050::dmpGetAccel(int32_t*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:541: error: no 'uint8_t MPU6050::dmpGetAccel(int16_t*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:549: error: no 'uint8_t MPU6050::dmpGetAccel(VectorInt16*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:557: error: no 'uint8_t MPU6050::dmpGetQuaternion(int32_t*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:566: error: no 'uint8_t MPU6050::dmpGetQuaternion(int16_t*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:575: error: no 'uint8_t MPU6050::dmpGetQuaternion(Quaternion*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:590: error: no 'uint8_t MPU6050::dmpGetGyro(int32_t*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:598: error: no 'uint8_t MPU6050::dmpGetGyro(int16_t*, const uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:608: error: no 'uint8_t MPU6050::dmpGetLinearAccel(VectorInt16*, VectorInt16*, VectorFloat*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:616: error: no 'uint8_t MPU6050::dmpGetLinearAccelInWorld(VectorInt16*, VectorInt16*, Quaternion*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:628: error: no 'uint8_t MPU6050::dmpGetGravity(VectorFloat*, Quaternion*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:639: error: no 'uint8_t MPU6050::dmpGetEuler(float*, Quaternion*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:645: error: no 'uint8_t MPU6050::dmpGetYawPitchRoll(float*, Quaternion*, VectorFloat*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:658: error: no 'uint8_t MPU6050::dmpProcessFIFOPacket(const unsigned char*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:668: error: no 'uint8_t MPU6050::dmpReadAndProcessFIFOPacket(uint8_t, uint8_t*)' member function declared in class 'MPU6050'
C:\Users\LordXaX\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:693: error: no 'uint16_t MPU6050::dmpGetFIFOPacketSize()' member function declared in class 'MPU6050'
sketch_dec08a.cpp: In function 'void setup()':
sketch_dec08a.cpp:177: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp:181: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp:182: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp:182: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp:185: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp:191: warning: only initialized variables can be placed into program memory area
sketch_dec08a:187: error: 'class MPU6050' has no member named 'dmpInitialize'
sketch_dec08a.cpp:197: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp:201: warning: only initialized variables can be placed into program memory area
sketch_dec08a:198: error: 'class MPU6050' has no member named 'getIntStatus'
sketch_dec08a.cpp:206: warning: only initialized variables can be placed into program memory area
sketch_dec08a:205: error: 'class MPU6050' has no member named 'dmpGetFIFOPacketSize'
sketch_dec08a.cpp:216: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp:218: warning: only initialized variables can be placed into program memory area
sketch_dec08a.cpp: In function 'void loop()':
sketch_dec08a:246: error: 'class MPU6050' has no member named 'getIntStatus'
sketch_dec08a.cpp:260: warning: only initialized variables can be placed into program memory area
sketch_dec08a:263: error: 'class MPU6050' has no member named 'getFIFOBytes'
How do I overcome this?
I've been trying very hard to use this device to get acceleration/gyroscope values. But still no success.
EDIT
This is what I get when trying to compile (verify).
The MPU6050_DMP6 example provided by Jeff works for me. From your compile error, it seems that you've included MPU6050.h, instead of MPU6050_6Axis_MotionApps20.h. Make sure you include the correct one.
If you look at the library code, you'll notice that the .dmp___ methods are not implemented in the MPU6050.cpp file, but in the MPU6050_6Axis_MotionApps20.h file. If this doesn't solve it, post your code.
try putting jeffs i2c .cpp and .h files into the same folder as the mpu6050 library files i found that this then worked for me, sorry if this is a litte late but hopefully helpful :P
I was having the same problem and it turned out I was including both
MPU6050.h and MPU6050_6Axis_MotionApps20.h. I commented out MPU6050.h and it now compiles fine. Seems that the former was overriding the latter.
I've solved the compile problem by putting I2Cdev.cpp and I2C.h in the MPU6050 library folder. (Mind: these are the dev files). These are Jeff's libraries and can be found at GitHub
Im programming an Arduino mega 2560.
And I bought an tft LCD and for that I want to use a SD card so I can put my pictures on it.
I downloaded this library but its giving me errors.
C:\Arduino\libraries\pff\pff.cpp: In function 'FRESULT pf_read(void*, short unsigned int, short unsigned int*)':
C:\Arduino\libraries\pff\pff.cpp:585: error: invalid conversion from 'void*' to 'unsigned char*'
The problem is imo here:
pff.cpp:
FRESULT pf_read (
void* buff, /* Pointer to the read buffer (NULL:Forward data to the stream)*/
WORD btr, /* Number of bytes to read */
WORD* br /* Pointer to number of bytes read */
)
pff.h:
FRESULT pf_read (void*, WORD, WORD*); /* Read data from the open file */
When I make it a .c file, it gives me more errors, like this one:
tft_menu.cpp.o: In function `open_root_dir()':
C:\AppData\Local\Temp\build7310099894910129341.tmp/tft_menu.cpp:594: undefined reference to `pf_opendir(_DIR_*, char const*)'
tft_menu.cpp.o: In function `mount_sd()':
C:\AppData\Local\Temp\build7310099894910129341.tmp/tft_menu.cpp:583: undefined reference to `disk_initialize()'
C:\AppData\Local\Temp\build7310099894910129341.tmp/tft_menu.cpp:585: undefined reference to `pf_mount(_FATFS_*)'
tft_menu.cpp.o: In function `bitmap_show(char*)':
C:\AppData\Local\Temp\build7310099894910129341.tmp/tft_menu.cpp:472: undefined reference to `pf_open(char const*)'
C:\AppData\Local\Temp\build7310099894910129341.tmp/tft_menu.cpp:476: undefined reference to `pf_read(void*, unsigned short, unsigned short*)'
C:\AppData\Local\Temp\build7310099894910129341.tmp/tft_menu.cpp:518: undefined reference to `pf_read(void*, unsigned short, unsigned short*)'
tft_menu.cpp.o: In function `show_bitmap()':
C:\AppData\Local\Temp\build7310099894910129341.tmp/tft_menu.cpp:603: undefined reference to `pf_readdir(_DIR_*, _FILINFO_*)'
so I think it should be compiled as a cpp.
EDIT:
I found out that I have to save is as cpp and in the program I have to write what icktoofay states
After that I got some errors, so I went to the line 585, as stated above and changed
BYTE *rbuff = buff;
into
BYTE rbuff = (unsigned char) buff;
And I found out that I had to add mcc.h to get rid of the errors of the "couldnt find resources".
And now Im getting these errors:
C:\libraries\mmc/mmc.h: In function 'void init_spi()':
C:\libraries\mmc/mmc.h:21: error: 'PORTL' was not declared in this scope
C:\libraries\mmc/mmc.h:21: error: 'PORTL0' was not declared in this scope
C:\libraries\mmc/mmc.h:22: error: 'PORTB' was not declared in this scope
C:\libraries\mmc/mmc.h:22: error: 'PORTB2' was not declared in this scope
C:\libraries\mmc/mmc.h:22: error: 'PORTB1' was not declared in this scope
C:\libraries\mmc/mmc.h:23: error: 'DDRB' was not declared in this scope
C:\libraries\mmc/mmc.h:23: error: 'PORTB0' was not declared in this scope
C:\libraries\mmc/mmc.h:25: error: 'DDRL' was not declared in this scope
C:\libraries\mmc/mmc.h:27: error: 'SPCR' was not declared in this scope
C:\libraries\mmc/mmc.h:27: error: 'SPE' was not declared in this scope
C:\libraries\mmc/mmc.h:27: error: 'MSTR' was not declared in this scope
C:\libraries\mmc/mmc.h:28: error: 'SPSR' was not declared in this scope
C:\libraries\mmc/mmc.h:28: error: 'SPI2X' was not declared in this scope
Ive tried to add #include TFT_ARDUINO_MEGA.h on top of the mcc.h and still no luck
Compile it as a C file, but in the file that uses it, include pff.h like this:
extern "C" {
#include <pff.h>
}
I have a very strange error in my Qt project. Here is the code, the main_window.h:
#include <QtGui>
#include <QtSql>
class main_window : public QTabWidget
{
Q_OBJECT
/// #name List Widgets
private:
QListWidget* m_documents_list;
....
and here is main_window.cpp:
...
void main_window::create_documents_widget()
{
m_documents = new QWidget(this);
m_documents_list = new QListWidget(m_documents);
}
...
The problem that I can't understand is in QListView, I'm not using it in my project. There is only QListWidget, but when I'm trying to build the project the following errors occur:
qlistview.h:194: error: ISO C++ forbids declaration of 'QListView' with no type
qlistview.h:194: error: expected ',' or '...' before '&' token
Also the following strange errors:
qlistwidget.h:308: error: no 'void QListWidget::removeItemWidget(QListWidgetItem)' member function declared in class 'QListWidget'*
qlistwidget.h:311: error: no 'void QListWidget::addItem(QListWidgetItem)' member function declared in class 'QListWidget'*
qlistwidget.h:314: error: no 'QListWidgetItem QListWidget::itemAt(int, int) const' member function declared in class 'QListWidget'*
etc.
Thanks in advance.
UPD: I'm using QtCreator 2.2.1 on Windows 7.
UPD2: Qt version is 4.7.1.
UPD3: The complete output
In file included from c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/QtGui:68,
from ..\my_project\/main_window.h:4,
from ..\my_project\main.cpp:2:
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistview.h:194: error: ISO C++ forbids declaration of 'QListView' with no type
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistview.h:194: error: expected ',' or '...' before '&' token
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistview.h:194: error: ISO C++ forbids declaration of 'QListView' with no type
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistview.h:194: error: ISO C++ forbids declaration of 'QListView' with no type
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistview.h:194: error: expected ';' before '&' token
In file included from c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/QtGui:69,
from ..\my_project\/main_window.h:4,
from ..\my_project\main.cpp:2:
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:202: error: redefinition of 'class QListWidget'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistview.h:58: error: previous definition of 'class QListWidget'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:308: error: no 'void QListWidget::removeItemWidget(QListWidgetItem*)' member function declared in class 'QListWidget'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:311: error: no 'void QListWidget::addItem(QListWidgetItem*)' member function declared in class 'QListWidget'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:314: error: no 'QListWidgetItem* QListWidget::itemAt(int, int) const' member function declared in class 'QListWidget'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h: In member function 'void QListWidgetItem::setSelected(bool)':
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:318: error: 'class QListWidget' has no member named 'setItemSelected'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h: In member function 'bool QListWidgetItem::isSelected() const':
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:321: error: 'class QListWidget' has no member named 'isItemSelected'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h: In member function 'void QListWidgetItem::setHidden(bool)':
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:324: error: 'class QListWidget' has no member named 'setItemHidden'
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h: In member function 'bool QListWidgetItem::isHidden() const':
c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui/qlistwidget.h:327: error: 'class QListWidget' has no member named 'isItemHidden'
Firstly - you should also mention qt version, as in this case that's most important.
This seems like some weird quirk of compiler or qt - my recomendation would be first to create simplest program where problem occurs. If it shows also in program like
#include <QtGui/QListWidget>
int main(int argc, char* argv[]){
QListWidget* w = 0;
}
then it is some problem with qt headers of compiler - then answer cannot be provided from data provided. If it works, then try to slowly add other elements of your code to this simple file - most likely at some point you will get the same error again - then you will know that last added piece of code is guilty. Some additional thinking might be required to figure out how to remove problem once located.
It should be noted that QListWidget inherits from QListView, so you are indirectly using it.
The error your getting looks like you're simply missing a #include <QListWidget> line in your header file.
Also, it could be that that you're missing #include guards in your header file
#ifndef MYCLASS
#define MYCLASS
class MyClass { ... };
#endif
If your header file is #included by more than one project then that would explain the errors you're seeing.