Compile error at omCommand.cpp:3765 in SequoiaDB - distributed-database

Describe the bug: Compile error at SequoiaDB/engine/omsvc/omCommand.cpp:3765
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/SequoiaDB/SequoiaDB.git
scons --engine
see error blow:
SequoiaDB/engine/omsvc/omCommand.cpp:3765:2: error: #endif without #if
#endif
^
SequoiaDB/engine/omsvc/omCommand.cpp:9875:2: error: #endif without #if #endif
^
SequoiaDB/engine/omsvc/omCommand.cpp:10669:2: error: #endif without #if #endif // SDB_ENTERPRISE

It looks like some mistake in the script remove code between SDB_ENTERPRISE macro before uploading to github. Now it is fixed.
enter image description here
enter image description here

Related

Trying to get 'Style' list for a GtkWidget

I'm trying hard to get a list of style properties for a GtkWidget (GtkButton). This is my code so far:
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char *argv[])
{
// Declare variables.
GtkWidget *btn = gtk_button_new();
guint *count = {0};
GParamSpec **list = NULL;
// Initialize gtk.
gtk_init(&argc, &argv);
// Get style properties.
list = gtk_widget_class_list_style_properties(GTK_WIDGET_CLASS(btn), count);
// Exit cleanly.
exit(EXIT_SUCCESS);
}
I get a clean compile with:
gcc -o gtk_test gtk_test.c `pkg-config --cflags --libs gtk+-3.0`
But I get the following errors when run:
(process:72182): Gtk-CRITICAL **: 10:42:23.167: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(process:72182): Gtk-CRITICAL **: 10:42:23.167: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(process:72182): Gtk-CRITICAL **: 10:42:23.167: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation fault
I don't think I'm doing it right, but I can't find any examples that use gtk_widget_class_list_style_properties that I understand. They ones I do find use klass and the first argument. But I can never find where klass is declared or even what it is.
Can someone please help point me in the right direction? I went to the gtk website and did a search on GTK_WIDGET_CLASS and it came back with nothing! Very frustrating to say the least.
What am I supposed to use for the GTK_WIDGET_CLASS argument that will return the style properties for a GtkButton?
I tried out your sample code. Actually, it looks like you just have the incorrect macro. Instead of:
GTK_WIDGET_CLASS(btn)
try:
GTK_WIDGET_GET_CLASS(btn)
I tried that and then received no critical messages.
Regards.

Macro expansion producing 'defined' has undefined behavior

We started seeing a lot of warnings like this after upgrading to Xcode 9.3:
Macro expansion producing 'defined' has undefined behavior
Like this:
#if MIXPANEL_FLUSH_IMMEDIATELY // ==> Warning: Macro expansion producing ...
[self flush];
#endif
And this:
#if !MIXPANEL_NO_AUTOMATIC_EVENTS_SUPPORT // ==> Warning: Macro expansion producing
- (void)setValidationEnabled:(BOOL)validationEnabled {
_validationEnabled = validationEnabled;
...
}
#endif
I guess the Macro can't be nested in Xcode 9.3.
I have these warnings too.
The Macro was defined like this, which cause the warnings:
#if TARGET_OS_MAC
#define SCENEKIT_SDK_AVAILABLE defined(POP_USE_SCENEKIT)
#elif TARGET_OS_IPHONE
#define SCENEKIT_SDK_AVAILABLE defined(POP_USE_SCENEKIT)
#endif
and I fixed it like this:
#if defined(POP_USE_SCENEKIT)
# define USE_SCENEKIT 1
#else
# define USE_SCENEKIT 0
#endif
#if TARGET_OS_MAC
#define SCENEKIT_SDK_AVAILABLE USE_SCENEKIT
#elif TARGET_OS_IPHONE
#define SCENEKIT_SDK_AVAILABLE USE_SCENEKIT
#endif
I seperated the Macro "SCENEKIT_SDK_AVAILABLE" like that, and the warnings were gone.
You can try my way.

Fortran code and Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols'

When I submit my package to cran I get the error as
Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols'
It is good practice to register native routines and to disable symbol
search.
My package was tested in this version of R by CRAN:
R version 3.4.0 alpha (2017-03-28 r72427)
Note that there is a solution for this error here
R CMD check note: Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’
but my external codes are in Fortran and tried the procedure described there but does not fix the issue for me. What can I do to overcome the issue?
Thanks
Update:
Following the procedure described https://www.r-bloggers.com/1-easy-package-registration/ I could pass the
Error:Found no calls to: ‘R_useDynamicSymbols’
But Found no call to: 'R_registerRoutines' still remains.
I solved the problem and you may find it useful for your own case.
Let's assume you have a subroutine called myf.f90 in src directory with following content:
SUBROUTINE cf(r,cd,loci)
INTEGER::r,cd
DOUBLE PRECISION::loci
....
....
....
END SUBROUTINE cf
To register this you need to do the following :
A) Run tools::package_native_routine_registration_skeleton("package directory")
B) Edit the output; for the example above would be:
#include <R.h>
#include <Rinternals.h>
#include <stdlib.h> // for NULL
#include <R_ext/Rdynload.h>
/* FIXME:
Check these declarations against the C/Fortran source code.
*/
/* .Fortran calls */
extern void F77_NAME(cf)(int *r, int *cd, double *loci);
static const R_FortranMethodDef FortranEntries[] = {
{"cf", (DL_FUNC) &F77_NAME(cf), 3},
{NULL, NULL, 0}
};
void R_init_packagename(DllInfo *dll)
{
R_registerRoutines(dll, NULL, NULL, FortranEntries, NULL);
R_useDynamicSymbols(dll, FALSE);
}
C) Copy and paste the full output in a packagename_init.c file to be put in src/
D) Update NAMESPACE, verifying that useDynLib(packagename, .registration = TRUE)

"compiling error" FreeRTOS Arduino Library with Visual Studio 2015 and Visual Micro plugin

I have recently installed MS Visual Studio 2015 with the Arduino plugin "Visual Micro".
Everything works fine, upload a sketch etc. Except when I try to compile my code when I use FreeRTOS. I downloaded the FreeRTOS libary through the Arduino IDE (library manager). Therefore(in MS VS 2015) I could chose to include the library in MS VS 2015. So I included the library in one of my sketches. Below you see my code example. Within the Arduino IDE i can compile the code and upload it to the device, but in MS VS there are some errors.
#include <timers.h>
#include <task.h>
#include <StackMacros.h>
#include <semphr.h>
#include <queue.h>
#include <projdefs.h>
#include <portmacro.h>
#include <portable.h>
#include <mpu_wrappers.h>
#include <list.h>
#include <FreeRTOSVariant.h>
#include <FreeRTOSConfig.h>
#include <event_groups.h>
#include <croutine.h>
#include <Arduino_FreeRTOS.h>
//define Tasks
void TaskBlinkSlow(void *pvParameters);
void TaskBlinkFast(void *pvParameters);
void setup()
{
/* add setup code here */
xTaskCreate(TaskBlinkSlow, "TaskSlow", 128, NULL, 1, NULL);
xTaskCreate(TaskBlinkFast, "TaskFast", 128, NULL, 2, NULL);
pinMode(13, OUTPUT);
}
void loop()
{
//Empty, things are done in tasks!!!
}
void TaskBlinkSlow(void * pvParameters)
{
for (;;) {
for (int i = 0; i < 8; i++) {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
vTaskDelay(5000 / portTICK_PERIOD_MS);
}
}
void TaskBlinkFast(void * pvParameters)
{
for (;;) {
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(500);
}
}
At the end of this post you will find the short snippet of the compilers error log. Maybe someone already came around the same issue and has a quick fix.
An example debugger breakpoint has been created. To switch the demo
breakpoint off, deselect Visual Micro>Tutorial Mode.
Compiling debug version of 'FreeRTOS' for 'Arduino/Genuino Uno'
FreeRTOS.ino:In file included from timers.h:75:3: error: #error
"include Arduino_FreeRTOS.h must appear in source files before include
timers.h" :#error "include Arduino_FreeRTOS.h must appear in source
files before include timers.h" timers.h:In file included from
FreeRTOS.ino:from task.h:75:3: error: #error "include
Arduino_FreeRTOS.h must appear in source files before include task.h"
:#error "include Arduino_FreeRTOS.h must appear in source files before
include task.h" task.h:In file included from timers.h:from
FreeRTOS.ino:from list.h:99:3: error: #error Arduino_FreeRTOS.h must
be included before list.h :#error Arduino_FreeRTOS.h must be included
before list.h FreeRTOS.ino:In file included from semphr.h:74:3: error:
error "include Arduino_FreeRTOS.h" must appear in source files before "include semphr.h" :#error "include Arduino_FreeRTOS.h" must appear in
source files before "include semphr.h" semphr.h:In file included from
FreeRTOS.ino:from queue.h:75:3: error: #error "include
Arduino_FreeRTOS.h" must appear in source files before "include
queue.h" :#error "include Arduino_FreeRTOS.h" must appear in source
files before "include queue.h" FreeRTOS.ino:In file included from
list.h:99:3: error: #error Arduino_FreeRTOS.h must be included before
list.h :#error Arduino_FreeRTOS.h must be included before list.h
task.h:In file included from timers.h:from FreeRTOS.ino:from
list.h:184:22: error: 'TickType_t' does not name a type
:configLIST_VOLATILE TickType_t xItemValue; *< The value being
listed. In most cases this is used to sort the list in descending
order. * list.h:196:22: error: 'TickType_t' does not name a type
:configLIST_VOLATILE TickType_t xItemValue list.h:208:22: error:
'UBaseType_t' does not name a type :configLIST_VOLATILE UBaseType_t
uxNumberOfItems list.h:386:47: error: expected initializer before
'PRIVILEGED_FUNCTION :void vListInitialise( List_t * const pxList )
PRIVILEGED_FUNCTION list.h:397:55: error: expected initializer before
'PRIVILEGED_FUNCTION :void vListInitialiseItem( ListItem_t * const
pxItem ) PRIVILEGED_FUNCTION list.h:410:77: error: expected
initializer before 'PRIVILEGED_FUNCTION :void vListInsert( List_t *
const pxList, ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION
list.h:431:80: error: expected initializer before 'PRIVILEGED_FUNCTION
:void vListInsertEnd( List_t * const pxList, ListItem_t * const
pxNewListItem ) PRIVILEGED_FUNCTION list.h:446:1: error: 'UBaseType_t'
does not name a type :UBaseType_t uxListRemove( ListItem_t * const
pxItemToRemove ) PRIVILEGED_FUNCTION timers.h:In file included from
FreeRTOS.ino:from task.h:109:20: error: ISO C++ forbids declaration of
'BaseType_t' with no type [-fpermissive] :typedef BaseType_t
(*TaskHookFunction_t)( void * ) task.h:109:20: error: typedef
'BaseType_t' is initialized (use decltype instead) task.h:109:22:
error: 'TaskHookFunction_t' was not declared in this scope :typedef
BaseType_t (*TaskHookFunction_t)( void * ) timers.h:In file included
from FreeRTOS.ino:from task.h:136:2: error: 'BaseType_t' does not name
a type :BaseType_t xOverflowCount task.h:137:2: error: 'TickType_t'
does not name a type :TickType_t xTimeOnEntering task.h:146:2: error:
'uint32_t' does not name a type :uint32_t ulLengthInBytes
task.h:147:2: error: 'uint32_t' does not name a type :uint32_t
ulParameters task.h:155:2: error: 'TaskFunction_t' does not name a
type :TaskFunction_t pvTaskCode task.h:157:2: error: 'uint16_t' does
not name a type :uint16_t usStackDepth task.h:159:2: error:
'UBaseType_t' does not name a type :UBaseType_t uxPriority
task.h:160:2: error: 'StackType_t' does not name a type :StackType_t
*puxStackBuffer task.h:161:27: error: 'portNUM_CONFIGURABLE_REGIONS' was not declared in this scope :MemoryRegion_t xRegions[
portNUM_CONFIGURABLE_REGIONS ] task.h:170:2: error: 'UBaseType_t' does
not name a type :UBaseType_t xTaskNumber; * A number unique to the
task. * task.h:172:2: error: 'UBaseType_t' does not name a type
:UBaseType_t uxCurrentPriority; * The priority at which the task was
running (may be inherited) when the structure was populated. *
task.h:173:2: error: 'UBaseType_t' does not name a type :UBaseType_t
uxBasePriority; * The priority to which the task will return if the
task's current priority has been inherited to avoid unbounded priority
inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is
defined as 1 in FreeRTOSConfig.h. * timers.h:In file include
If you read the error messages, the issue is explained clearly.
include Arduino_FreeRTOS.h must appear first.
Your example shows it included last.
Put it first and the errors will go away.
Arduino_FreeRTOS.h includes many definitions that are used in other places, hence the need for it to be first.
Unrelated to your question, but using delay() is nasty as it consumes CPU cycles needlessly. Try vTaskDelay() as alternative which defers (or blocks) to the Scheduler to unblock other Tasks or run the idle Task which is the Arduino loop() function.
The loop() function can then put the CPU to sleep, reducing power consumption. See the feilipu.me post on topic for more.
vTaskDelay() counts Ticks, so hence the need to divide by the Tick period in milliseconds. i.e.
Time in ms / portTICK_PERIOD_MS = Ticks
#include <Arduino_FreeRTOS.h>
#include <croutine.h>
#include <event_groups.h>
#include <FreeRTOSConfig.h>
#include <FreeRTOSVariant.h>
#include <list.h>
#include <mpu_wrappers.h>
#include <portable.h>
#include <portmacro.h>
#include <projdefs.h>
#include <queue.h>
#include <semphr.h>
#include <Stack_Macros.h>
#include <task.h>
#include <timers.h>
void setup()
{
}
void loop()
{
}
Found the issue, the includes where in the wrong order: dont know why;).
You cant only include freeRTOS in MS VS you need to correct the order of the includes by yourself.
Here is the correct order:
#include <Arduino_FreeRTOS.h>
#include <croutine.h>
#include <event_groups.h>
#include <FreeRTOSConfig.h>
#include <FreeRTOSVariant.h>
#include <list.h>
#include <mpu_wrappers.h>
#include <portable.h>
#include <portmacro.h>
#include <projdefs.h>
#include <queue.h>
#include <semphr.h>
#include <StackMacros.h>
#include <task.h>
#include <timers.h>
I'm not sure about the Arduino code you are referring to, but normally there is no reason to include FreeRTOSConfig.h directly - instead include FreeRTOS.h first, and that will get the ordering of the port layer files and FreeRTOSConfig.h files correct for you, then include the header files that contain the API functions you want to use.

QT Plugin with CMake

Greetings all,
I am trying to implement a QT Plugin with CMake. But this "Q_EXPORT_PLUGIN2" directive stops my class from compiling. I can compile the plugin if I commented this out,but it won't work as a plugin if I do so.
QT doc says:
Q_EXPORT_PLUGIN2 ( PluginName, ClassName )
The value of PluginName should
correspond to the TARGET specified in
the plugin's project file
What about in CMake case? What should be the value for 'PluginName'?
Here is my Plugin Interface :
#ifndef RZPLUGIN3DVIEWERFACTORY_H_
#define RZPLUGIN3DVIEWERFACTORY_H_
#include <QObject>
#include "plugin/IRzPluginFactory.h"
class RzPlugin3DViewerFactory :public QObject,public IRzPluginFactory{
Q_OBJECT
Q_INTERFACES(IRzPluginFactory)
private:
QString uid;
public:
RzPlugin3DViewerFactory();
virtual ~RzPlugin3DViewerFactory();
IRzPlugin* createPluginInstance();
IRzPluginContext* createPluginContextInstance();
QString & getPluginUID();
};
#endif /* RZPLUGIN3DVIEWERFACTORY_H_ */
And implementation
#include "RzPlugin3DViewerFactory.h"
#include "RzPlugin3DViewer.h"
RzPlugin3DViewerFactory::RzPlugin3DViewerFactory() {
uid.append("RzPlugin3DView");
}
RzPlugin3DViewerFactory::~RzPlugin3DViewerFactory() {
// TODO Auto-generated destructor stub
}
IRzPlugin* RzPlugin3DViewerFactory::createPluginInstance(){
RzPlugin3DViewer *p=new RzPlugin3DViewer;
return p;
}
IRzPluginContext* RzPlugin3DViewerFactory::createPluginContextInstance()
{
return NULL;
}
QString & RzPlugin3DViewerFactory::getPluginUID()
{
return uid;
}
Q_EXPORT_PLUGIN2(pnp_extrafilters, RzPlugin3DViewerFactory)
Error Message is :
[ 12%] Building CXX object
CMakeFiles/RzDL3DView.dir/RzPlugin3DViewerFactory.cpp
.obj
C:\svn\osaka3d\trunk\osaka3d\rinzo-platform\src\dlplugins\threedviewer\RzPlugin3
DViewerFactory.cpp:36: error: expected
constructor, destructor, or type
conversi on before '(' token make[2]:
*** [CMakeFiles/RzDL3DView.dir/RzPlugin3DViewerFactory.cpp.obj]
Error 1
make[1]: *
[CMakeFiles/RzDL3DView.dir/all] Error
2 make: * [all] Error 2
Ok , I fixed the problem by giving the project name specified in Cmake file.
PROJECT (RinzoDLPlugin3DViewer CXX C)
So,now in CPP file its
Q_EXPORT_PLUGIN2(RinzoDLPlugin3DViewer , RzPlugin3DViewerFactory)
and included qpluginh.h
#include <qplugin.h>
I think the macro should be Q_EXPORT_PLUGIN2(pnp_rzplugin3dviewerfactory, RzPlugin3DViewerFactory) or whatever you have listed as the target name in the .pro file. In fact, the "pnp" part stands for "Plug & Paint" which is the Qt demo program for writing plugins :)
Edit:
Since I misunderstood how CMake works, this information isn't really relevant to the OP. I did do a quick search however and turned up this discussion of Qt, plugins and CMake. I hope there is some useful info there.
http://lists.trolltech.com/qt-interest/2007-05/msg00506.html

Resources