Receiving unusual error messages when installing an R package directly from a file - https://pm2.phs.ed.ac.uk/genoscores/:
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/RcppEigenForward.h:26:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/RcppCommon.h:30:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp/r/headers.h:62:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
~~^
/usr/local/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
^
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppEigen/include/RcppEigenForward.h:26:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/RcppCommon.h:30:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp/r/headers.h:62:
In file included from /Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:320:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:321:9: error: no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:322:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:323:9: error: no member named 'isgreater' in the global namespace
using ::isgreater;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:324:9: error: no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:325:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:326:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:327:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:328:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:640:26: error: no template named 'numeric_limits'
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:640:60: error: no template named 'numeric_limits'
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:641:18: error: no template named 'numeric_limits'
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:641:50: error: no template named 'numeric_limits'
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:646:17: error: no template named 'numeric_limits'
static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix");
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:649:25: error: no template named 'numeric_limits'
return _FloatBigger ? numeric_limits<_IntT>::max() : (numeric_limits<_IntT>::max() >> _Bits << _Bits);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘genoscores’
The package isn't available anywhere else.
I have all the dependencies.
I don't know where to start deciphering this, is it a problem with compilers?
Related
I tried to compile source for OMNeT++ 5.6.2 in my computer (macOS Catalina 10.15.5).
But make some error during "make" command.
I don't know why occurs this error. I think the error is probably from "Qtenv" or "QT".
I also deleted "Command Line Tools" and reinstalled it, but the error still occurs.
Also I saw OMNeT++ installation guidebook that very simple step. This book description installation method by execute command "./configure" and "make" or "make -j4".
How to fix below error?
kimminwoo#Macbook-Pro-2020-13-inch-for-Minwoo omnetpp-5.6.2 % make
/Library/Developer/CommandLineTools/usr/bin/make -s MODE=release
***** Configuration: MODE=release, TOOLCHAIN_NAME=clang, LIB_SUFFIX=.dylib ****
===== Checking environment =====
===== Compiling utils ====
===== Compiling common ====
===== Compiling layout ====
===== Compiling eventlog ====
===== Compiling scave ====
===== Compiling nedxml ====
===== Compiling sim ====
===== Compiling envir ====
===== Compiling cmdenv ====
===== Compiling qtenv ====
animationcontrollerdialog.cc
In file included from animationcontrollerdialog.cc:20:
In file included from ./qtenv.h:33:
In file included from ./inspector.h:22:
In file included from ./qtutil.h:25:
In file included from /Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/QTimer:1:
/Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/qtimer.h:106:50: error: no template named 'is_same' in namespace 'QtPrivate'; did you mean
'std::is_same'?
!QtPrivate::is_same<const char*, Func1>::value, void>::Type
^~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:883:61: note: 'std::is_same' declared here
template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {};
In file included from animationcontrollerdialog.cc:20:
In file included from ./qtenv.h:33:
In file included from ./inspector.h:22:
In file included from ./qtutil.h:25:
In file included from /Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/QTimer:1:
/Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/qtimer.h:113:50: error: no template named 'is_same' in namespace 'QtPrivate'; did you mean
'std::is_same'?
!QtPrivate::is_same<const char*, Func1>::value, void>::Type
^~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:883:61: note: 'std::is_same' declared here
template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {};
In file included from animationcontrollerdialog.cc:20:
In file included from ./qtenv.h:33:
In file included from ./inspector.h:22:
In file included from ./qtutil.h:25:
In file included from /Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/QTimer:1:
/Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/qtimer.h:121:50: error: no template named 'is_same' in namespace 'QtPrivate'; did you mean
'std::is_same'?
!QtPrivate::is_same<const char*, Func1>::value, void>::Type
^~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:883:61: note: 'std::is_same' declared here
template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {};
In file included from animationcontrollerdialog.cc:20:
In file included from ./qtenv.h:33:
In file included from ./inspector.h:22:
In file included from ./qtutil.h:25:
In file included from /Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/QTimer:1:
/Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtCore/qtimer.h:128:50: error: no template named 'is_same' in namespace 'QtPrivate'; did you mean
'std::is_same'?
!QtPrivate::is_same<const char*, Func1>::value, void>::Type
^~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:883:61: note: 'std::is_same' declared here
template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {};
In file included from animationcontrollerdialog.cc:20:
In file included from ./qtenv.h:33:
In file included from ./inspector.h:25:
In file included from /Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtWidgets/QMenu:1:
/Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtWidgets/qmenu.h:91:43: error: no template named 'is_same' in namespace 'QtPrivate'; did you mean
'std::is_same'?
inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
^~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:883:61: note: 'std::is_same' declared here
template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {};
In file included from animationcontrollerdialog.cc:20:
In file included from ./qtenv.h:33:
In file included from ./inspector.h:25:
In file included from /Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtWidgets/QMenu:1:
/Users/kimminwoo/Desktop/omnetpp-5.6.2/tools/macosx/include/QtWidgets/qmenu.h:119:43: error: no template named 'is_same' in namespace 'QtPrivate'; did you mean
'std::is_same'?
inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
^~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:883:61: note: 'std::is_same' declared here
template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {};
^
6 errors generated.
make[2]: *** [/Users/kimminwoo/Desktop/omnetpp-5.6.2/out/clang-release/src/qtenv/animationcontrollerdialog.o] Error 1
make[1]: *** [qtenv] Error 2
make: *** [allmodes] Error 2
I got some solution here this problem!
I had to big mistake because I did install "qt" from "homebrew" package manager.
So I did uninstall "qt" package by using "homebrew" and above problem was solved.
Hope it helps those who have the same problem as me!
Instead of completely uninstalling qt, you can just unlink it:
brew unlink qt
We are working on a GluonMobile App and the keyboard on Android an iOS is only showing up once, also it is hiding TextFields that are near the bottom of the screen itself.
We wanted to implement the solution provided here:
How to make the SoftKeyboard show up again
However, after adding all the necessary classes we are not able to deploy it, we get the following errors:
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:3: error: package android.graphics does not exist
import android.graphics.Rect;
^
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:4: error: package android.view does not exist
import android.view.ViewTreeObserver;
^
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:5: error: package android.view.inputmethod does not exist
import android.view.inputmethod.InputMethodManager;
^
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:13: error: package javafxports.android does not exist
import javafxports.android.FXActivity;
^
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:19: error: cannot find symbol
private final InputMethodManager imm;
^
symbol: class InputMethodManager
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:21: error: cannot find symbol
private Rect currentBounds;
^
symbol: class Rect
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:24: error: package ViewTreeObserver does not exist
private ViewTreeObserver.OnGlobalLayoutListener layoutListener;
^
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:50: error: package ViewTreeObserver does not exist
private ViewTreeObserver.OnGlobalLayoutListener layoutListener(DoubleProperty height) {
^
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:17: error: cannot find symbol
private static final float SCALE = FXActivity.getInstance().getResources().getDisplayMetrics().density;
^
symbol: variable FXActivity
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:29: error: cannot find symbol
imm = (InputMethodManager) FXActivity.getInstance().getSystemService(FXActivity.INPUT_METHOD_SERVICE);
^
symbol: class InputMethodManager
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:29: error: cannot find symbol
imm = (InputMethodManager) FXActivity.getInstance().getSystemService(FXActivity.INPUT_METHOD_SERVICE);
^
symbol: variable FXActivity
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:29: error: cannot find symbol
imm = (InputMethodManager) FXActivity.getInstance().getSystemService(FXActivity.INPUT_METHOD_SERVICE);
^
symbol: variable FXActivity
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:35: error: cannot find symbol
currentBounds = new Rect();
^
symbol: class Rect
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:42: error: cannot find symbol
FXActivity.getViewGroup().getViewTreeObserver().addOnGlobalLayoutListener(layoutListener);
^
symbol: variable FXActivity
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:45: error: cannot find symbol
l.addListener(LifecycleEvent.RESUME, () -> FXActivity.getViewGroup().getViewTreeObserver().addOnGlobalLayoutListener(layoutListener));
^
symbol: variable FXActivity
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:46: error: cannot find symbol
l.addListener(LifecycleEvent.PAUSE, () -> FXActivity.getViewGroup().getViewTreeObserver().removeOnGlobalLayoutListener(layoutListener));
^
symbol: variable FXActivity
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:55: error: cannot find symbol
FXActivity.getViewGroup().getRootView().getWindowVisibleDisplayFrame(currentBounds);
^
symbol: variable FXActivity
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:72: error: cannot find symbol
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
^
symbol: variable InputMethodManager
location: class AndroidKeyboardService
C:\GluonApp\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidKeyboardService.java:79: error: cannot find symbol
imm.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);
^
symbol: variable InputMethodManager
location: class AndroidKeyboardService
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
19 errors
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
What would the imports be or how can we successfully deploy it?
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.
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
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.