My project is using both Qt (included Qwt) and Boost::signals. As known, their macros are incompatible with each other. I compiled my project with CONFIG += no_keywords and renamed all Qt macros with upper-case registry i.e. signals = Q_SIGNALS. There are no more errors in project, but now I have errors in Qwt includes like this
/usr/include/qwtplot3d/qwt3d_extglwidget.h:101:1: error: ‘signals’ does not name a type
/usr/include/qwtplot3d/qwt3d_extglwidget.h:116:8: error: expected ‘:’ before ‘slots’
/usr/include/qwtplot3d/qwt3d_extglwidget.h:116:8: error: ‘slots’ does not name a type
It seems that Qwt is still conflicting with Boost::signals. What can I do here?
Qwt is compatible with boost signals - you are talking about a lib called QwtPlot3D !
When you want to use boost signals with QwtPlot3D you have to patch its implementation replacing the signal/slot/emit macros like you did it with your code.
Related
I have no idea why this is happening. But everytime I compile my application with a couple of the Qt versions that I have installed I now get these warnings:
In file included from /home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qbrush.h:50,
from /home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qpalette.h:46,
from /home/Qt5.9.2/5.9.2/gcc_64/include/QtWidgets/qwidget.h:48,
from /home/Qt5.9.2/5.9.2/gcc_64/include/QtWidgets/qdesktopwidget.h:44,
from /home/Qt5.9.2/5.9.2/gcc_64/include/QtWidgets/QDesktopWidget:1,
from ../src/../../CommonClasses/SQLConn/../../CommonClasses/common.h:6,
from ../src/../../CommonClasses/SQLConn/dbinterface.h:10,
from ../src/../../EyeExperimenter/src/sslclient/sslclient.h:10,
from ../src/../../EyeExperimenter/src/sslclient/ssldbclient.h:4,
from ../src/sslwrapper.h:6,
from ../src/main.cpp:3:
/home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qtransform.h: In member function ‘QTransform& QTransform::operator=(QTransform&&)’:
/home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qtransform.h:81:46: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class QTransform’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
{ memcpy(this, &other, sizeof(QTransform)); return *this; }
^
/home/Qt5.9.2/5.9.2/gcc_64/include/QtGui/qtransform.h:57:20: note: ‘class QTransform’ declared here
class Q_GUI_EXPORT QTransform
Can any one tell me what this warning is and, more importantly, how do I get rid of it? From what I've seen it has to do with gcc8 which my system currently has, however I've tried chaging the compiler in the Qt Kits configuration of QtCreator and the warning still appears...
You use qmake as the build system generator, and then gnu make to actually build stuff - Qt Creator is just a shortcut from typing it all out on the command line :)
You can pass the relevant flag to the compiler by adding the following to your .pro file, then re-running qmake on the project (e.g. delete the build folder and build again):
QMAKE_CFLAGS_WARN_ON += -Wno-class-memaccess
QMAKE_CXXFLAGS_WARN_ON += -Wno-class-memaccess
QMAKE_CFLAGS += -Wno-class-memaccess
QMAKE_CXXFLAGS += -Wno-class-memaccess
I am creating a Webots project on OSX, where I am including the following:
#include <core/MainApplication.hpp>
I get error
In file included from
/Applications/Webots/resources/projects/default/libraries/qt_utils/core/MainApplication.hpp:17:
/Applications/Webots/webots.app/Contents/Frameworks/QtWidgets.framework/Headers/QApplication:1:10:
fatal error: 'qapplication.h' file not found
include "qapplication.h"
1 error generated.
All contnet of /Applications/Webots/webots.app/Contents/Frameworks/QtWidgets.framework/Headers/QApplication:
#include "qapplication.h"
QApplication file content is too short. Also it seems like I cannot find qapplication.h on the file system, is that normal?
Would it be more sensible to use local installation of Qt framework than the one that comes with Webots? How do I change the .pro file then to link to local installation of Qt rather than to /Applications/Webots/resources/projects/default/libraries/qt_utils
My make file:
CXX_SOURCES = entry_points.cpp
QT = core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
USE_C_API = true
QT_UTILS = /Applications/Webots/resources/projects/default/libraries/qt_utils
INCLUDE = -I"$(QT_UTILS)"
LIBRARIES = -L"$(QT_UTILS)" -lqt_utils
space :=
space +=
WEBOTS_HOME_PATH=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME))))
include /Applications/Webots/resources/Makefile.include
EDIT:
I have discovered that when I try to run make in the folder: /Applications/Webots/resources/projects/default/libraries/qt_utils
I get many errors (among many others), such as:
/Applications/Webots/webots.app/Contents/Frameworks/QtWidgets.framework/Headers/QWidget:1:10:
fatal error: 'qwidget.h' file not found
include "qwidget.h"
...
/Applications/Webots/webots.app/Contents/Frameworks/QtCore.framework/Headers/QObject:1:10:
fatal error: 'qobject.h' file not found
include "qobject.h"
...
/Applications/Webots/webots.app/Contents/Frameworks/QtWidgets.framework/Headers/QApplication:1:10:
fatal error: 'qapplication.h' file not found
include "qapplication.h"
In facts, these files are indeed missing from the Webots qt_utils
This is probably because of this line:
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
Indeed, QT_MAJOR_VERSION and greaterThan are not a part of the Webots Makefile system. If the Qt widgets module is not present, then the qapplication.h cannot be found (because it is precisely defined in the widgets module). As Webots is using Qt 5 since a while, I would recommend you to simply define the Qt modules like this:
QT = core gui widgets
I am am unable to get avr-elf-windows and WinAVR to work. I have managed to build the example supplied with avr-elf-windows (ATmega2560). But if I try and expand to use another chip or start using the WinAVR supplied packages and projects I keep getting errors I cannot work out.
Method 1:
Modify the ATmega2560 example to use the WinAVR packages.
Changed:
with Atmega2560; use Atmega2560;
to:
with AVR; use AVR;
with AVR.Atmega328p; use AVR.atmega328p;
Create a project file to include:
with "C:\WinAVR-20100110\lib\gnat\avr.gpr";
with "C:\WinAVR-20100110\lib\gnat\avr_app.gpr";
Running make I get the following error:
avr-gnatmake: "C:\WinAVR-20100110\lib\gnat\avr_lib\avr-int_img.adb" compilation error
Great, I have a compilation issue, but I cannot see the error.
Method 2:
Open the above project file in GPS. Change the build setting to be gnatmake. GPS now starts reporting errors and warnings:
Project warning: object directory "avr_lib/avr5/obj" not found
Project library directory "C:\WinAVR-20100110\lib\gnat\avr_lib\avr5\lib\" does not exist
The latter issue is very clearly the fact that I have not set up GPS correctly to tell it the values of microcontroller and architecture, but I cannot seem to find anything to resolve this.
Method 3:
To use the WinAVR set up directly using makefiles which then gives me the error:
avr-gnatmake: RTS path not valid: missing adainclude and adalib directories
If I follow the instructions I can find by searching the web I can only find details for building the required libraries under Linux.
Platform: Windows 7.
With the combination of the two answers above I have now managed to link my sample code. As to wether it will work on the Arduino, that is a different issue.
Many thanks for the help.
I have found it a bit frustrating to get this far, and I wonder if there are others out there who may just give up on Ada on the Arduino and go back to the Arduino IDE and therefore missing out on the opportunity to learn a language with more structure. There are many misleading pages out there that also do not help.
You might want to take a look in the paper Integrating 8-bit AVR Micro-Controllers in Ada. Basically you can use a GPS project file arduino.gpr like
project Arduino is
for Source_Dirs use (".", "src");
for Object_Dir use "obj";
for Exec_Dir use "bin";
for Main use ("main.adb");
package Compiler is
for Default_Switches ("ada") use ("-mmcu=avr5");
end Compiler;
package Ide is
for Gnat use "avr-gnat";
for Gnatlist use "avr-gnatls";
for Debugger_Command use "avr-gdb";
end Ide;
package Builder is
for Executable_Suffix use ".elf";
for Default_Switches ("ada") use ("--RTS=rts-zfp");
end Builder;
package Linker is
for Default_Switches ("ada") use ("obj\crtm328p._o", "-nostdlib", "-lgcc", "-mavr5", "-Tdata=0x00800200", "-mmcu=avr5");
end Linker;
end Arduino;
and you can code a spec for your ATmega328P like
with Interfaces; use Interfaces;
with System;
package ATmega328P is
-- PORTB: Port B Data Register
PORTB : Unsigned_8;
for PORTB'Address use System'To_Address (16#25#);
-- DDRB: Port B Data Direction Register
DDRB : Unsigned_8;
for DDRB'Address use System'To_Address (16#24#);
-- PINB: Port B Input Pins
PINB : Unsigned_8;
for PINB'Address use System'To_Address (16#23#);
end ATmega328P;
to be imported by your main file or libraries.
Bear with me if this isn't the immediate answer; I have only used the AVR-Ada toolchain on Linux, so we may have to iterate towards a solution unless someone else spots the problem first.
The first thing to decipher is which version of the AVR-Ada tools you have:
your project file USED to need (using avr-ada 1.1)
with "C:\WinAVR-20100110\lib\gnat\avr.gpr";
Now with avr-ada 1.2.1 you need (instead)
with "C:\WinAVR-20100110\lib\gnat\avr_app.gpr";
for building applications, and <same path>/avr_lib.gpr for libraries.
I don't believe you ever need both! And they may conflict with each other.
I don't know the state of the Windows binary build, but if you need the latest version (recommended : it's a real improvement) you may need to build it from source.
Method 1 : were you running Make from a command line? If so, I would expect to see errors in all their gory details.
Method 2 : can't help you here, I don't know GPS well enough. However I can say that on Linux there are no "avr5" folders in [wherever]/avr/lib/gnat/avr_lib. (AVR5 is correct for the 328p)
Instead there IS a [wherever]/avr/lib/avr5 containing libc and other C-related objects - including the crtm328p.o that Rego names in his linker switches, and a [wherever]/lib/gcc/avr/4.7.2/avr5 folder containing libgcc.a. You probably need to find the former and point GPS at it...
Method 3 : This looks the easiest to fix. The "gnatmake" command needs an --RTS= option pointing at the correct RTS for the 328p. This should be --RTS=rts/avr5 assuming the RTS is correctly installed.
Alternatively a full path ought to work. Here, that would be
--RTS=/opt/avr_472_gnat/lib/gcc/avr/4.7.2/rts/avr5
on Windows you may have to poke around to find the correct path.
Using Method 1 this --RTS option is automatically generated by avr_app.gpr.
It appears that having a mix of 3 or 4 tool chains installed that provide one of aspects of WinAvr, AvrAda causes significant problems (these included WinAvr, Avr-Ada, Cygwin, AVR compiler by Adacore and MinWG).
Starting with a brand new Win7 or Win8 installation perform the following:
Install WinAVR-20100110 to C:\WinAVR-20100110
Copy the content of the Avr-Ada-1.2.0_bin to C:\avr-ada-1.2.0
Add C:\avr-ada-1.2.0\bin to the PATH
Compiling the content of each of the examples in C:\avr-ada-1.2.0\share\doc\avr-ada\apps identifies that some DLLs are missing: libiconv-2.dll, libgmp-10.dll, libmpc-2.dll, libmpfr-1.dll
These can be found in a MinGW installtion.
Create a virtual machine to install MinGW on, in order to ensure it did not mess with the main PC.
Copy the missing DLLs in C:\WinAVR-20100110\bin
The example in DS1820 will not compile due to crc_lib being missing.
In order to upload to the Arduino the makefiles must be modified for your local installation, board type etc.
I have an Xcode 3.2 project (sqlite3 with icu) that builds correctly, and I'm trying to recreate it in Xcode 4. I'm getting link errors:
Undefined symbols for architecture x86_64:
"vtable for __cxxabiv1::__si_class_type_info", referenced from:
typeinfo for icu_48::SortKeyByteSinkin libicui18n.a(ucol.ao)
...
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in libicui18n.a(uregex.ao)
...
I had this once before, with Xcode 3.2. I it then by changing build setting Linking-> C++ Standard Library Type to static (the default is dynamic). If I understand the docs correctly, the actual flag is STANDARD_C_PLUS_PLUS_LIBRARY_TYPE.
But I can't find that setting in Xcode 4!
EDIT
The main module (sqlite3) is C, but the ICU library is C++, presumably with C declarations. I can build sqlite3 fine by itself, it's when I need to link in the ICU library that the trouble starts.
Your app may be C but it looks like libicui18n includes C++.
What happens if you rename your main.m to main.mm? That should cause it to be linked against the standard C++ library.
I'm trying to build a simple application that uses ffmpeg's libav* libraries in xcode 4 and getting the following error:
ld: illegal text reloc to non_lazy_ptr from /ffmpeg/temp/ffmpeg-0.8/builduni/lib/libavcodec.a(ac3.o) in _ff_ac3_bit_alloc_calc_psd for architecture i386
I've already tried to run ranlib -c libavcodec.a to fix this problem, but nothing happend.
One more thing: my libav* libraries are fat binaries (i386 + x86_64).
Any ideas what can it be?
I have the same error. Finally, I got the solution at
http://lists.apple.com/archives/unix-porting/2008/Jan/msg00027.html
just add other link flag:
-read_only_relocs suppress
* EXPLANATION * The two assembly commands load the absolutes address of _trail into R15. Doing so is fine if _trail is ultimately
in the same linkage unit. _trail is in libmodule.dylib. For this to
work, at runtime the dynamic loader (dyld) would have to rewrite the
two instructions. Normally dyld only updates data pointers. One work
around is to make libdyalog an archive (e.g. libdyalog.a) and link
that with pere.s. Then all the code would be in the same linkage unit,
so there would be no need for runtime text relocs. The runtime (dyld)
does support text relocs (updating instructions) for i386, but you
need to link with -read_only_relocs suppress.