c++11

How to pass C++11 flag down to “npm install”?

女生的网名这么多〃 提交于 2021-02-11 13:32:55
问题 I am trying to install the "opencv4nodejs" package on a MAC by running this command: CXXFLAGS=-std=gnu++11 npm i -g opencv4nodejs That gives me the following error: /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/opencv/modules/highgui/src/window_cocoa.mm:269:25: error: non-constant-expression cannot be narrowed from type 'int' to 'CGFloat' (aka 'double') in initializer list [-Wc++11-narrowing] NSSize size = { width, height }; ^~~~~ /usr/local/lib/node_modules

Can I EnterCriticalSection(s) in thread A then LeaveCriticalSection(s) in thread B?

佐手、 提交于 2021-02-11 11:48:31
问题 So i have SEND_SLOT struct: struct SEND_SLOT { SEND_BUFFER buffer; uint16 index; CRITICAL_SECTION slotLock; }; and a connexion struct: struct connexion { ... SEND_SLOT sendSlots[3]; ... } and in thread A i do: if(TryEnterCriticalSection(&sendSlots[i])) { //Post send request... WSASend(...); } and in thread B i do: while(...) { ... //request finished, data sent, and i get the index to the SEND_SLOT LeaveCriticalSection(&sendSlots[index]); ... } So i'm trying to lock the SEND_SLOT i in thread A

Need help getting intel TBB working?

社会主义新天地 提交于 2021-02-11 08:30:00
问题 I ran brew install tbb on my mac os sierra device. After running this i should be able to include #include into my c++ projects right? For some reason when I compile these files are not found. Help would be appreciated 回答1: A few things... Check the options on packages Before you install any homebrew packages, get in the habit of checking the available options rather than just accepting the default ones. It often gives you insights into features that are available which you are unaware of. So

Qt Logging tool multithreading, calling signal and slot with variable number of arguments form another thread, mixing C and C++

十年热恋 提交于 2021-02-11 08:08:09
问题 This is my Logging class: #include "log.h" #include "ui_log.h" #include <QDebug> #include <QMutex> bool Log::logOpen = false; Log::Log(QWidget *parent) : QDialog(parent), ui(new Ui::Log) { ui->setupUi(this); text = new QString; this->bar = this->ui->logText->verticalScrollBar(); connect(this, SIGNAL(call_write(char*)), this, SLOT(write(char*))); } Log::~Log() { delete ui; } void Log::on_buttonClose_clicked() { Log::logOpen = false; close(); } void Log::on_buttonClear_clicked() { this->text-

Qt Logging tool multithreading, calling signal and slot with variable number of arguments form another thread, mixing C and C++

此生再无相见时 提交于 2021-02-11 08:07:59
问题 This is my Logging class: #include "log.h" #include "ui_log.h" #include <QDebug> #include <QMutex> bool Log::logOpen = false; Log::Log(QWidget *parent) : QDialog(parent), ui(new Ui::Log) { ui->setupUi(this); text = new QString; this->bar = this->ui->logText->verticalScrollBar(); connect(this, SIGNAL(call_write(char*)), this, SLOT(write(char*))); } Log::~Log() { delete ui; } void Log::on_buttonClose_clicked() { Log::logOpen = false; close(); } void Log::on_buttonClear_clicked() { this->text-

Creating ordered multiset with correctly working find()

為{幸葍}努か 提交于 2021-02-11 06:26:10
问题 I tried to create ordered multiset with such code: #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; template <class type1> using ordered_multiset = tree <type1, null_type, less_equal <type1>, rb_tree_tag, tree_order_statistics_node_update>; ordered_multiset <ll> kek; int main() { kek.insert(1); kek.insert(1); kek.insert(2); kek.insert(2); kek.insert(2); kek.insert(3);

Libs and linker with CMake and MySQL C++ Connector?

倾然丶 夕夏残阳落幕 提交于 2021-02-11 06:02:14
问题 I download the MySQL C++ Connector, I need it for a project in CLion, now, I was trying to make it run, but it was all in vain, I get the error -1073741515 (0xC0000135), i've read that is about a linking or lib problem. My current CMake: cmake_minimum_required(VERSION 3.6) project(Entrenamiento CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_FLAGS "-Wall") set(SOURCE_FILES main.cpp) set(Entrenamiento_VERSION_MAJOR 1) set(Entrenamiento_VERSION_MINOR 0) add_library(mysqlcppconn SHARED IMPORTED)

Libs and linker with CMake and MySQL C++ Connector?

霸气de小男生 提交于 2021-02-11 06:01:17
问题 I download the MySQL C++ Connector, I need it for a project in CLion, now, I was trying to make it run, but it was all in vain, I get the error -1073741515 (0xC0000135), i've read that is about a linking or lib problem. My current CMake: cmake_minimum_required(VERSION 3.6) project(Entrenamiento CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_FLAGS "-Wall") set(SOURCE_FILES main.cpp) set(Entrenamiento_VERSION_MAJOR 1) set(Entrenamiento_VERSION_MINOR 0) add_library(mysqlcppconn SHARED IMPORTED)

Are these allowed optimizations in C++? [duplicate]

纵然是瞬间 提交于 2021-02-11 05:09:12
问题 This question already has answers here : Why don't compilers merge redundant std::atomic writes? (9 answers) Can atomic loads be merged in the C++ memory model? (2 answers) Closed 9 months ago . Let std::atomic<std::int64_t> num{0}; be defined somewhere accessible/visible in the code. Is the C++ compiler allowed to replace each of the following two codes with an empty code (something that does nothing)? Similarly, are these optimizations allowed to happen at runtime? I am just trying to get a

Are these allowed optimizations in C++? [duplicate]

偶尔善良 提交于 2021-02-11 05:08:31
问题 This question already has answers here : Why don't compilers merge redundant std::atomic writes? (9 answers) Can atomic loads be merged in the C++ memory model? (2 answers) Closed 9 months ago . Let std::atomic<std::int64_t> num{0}; be defined somewhere accessible/visible in the code. Is the C++ compiler allowed to replace each of the following two codes with an empty code (something that does nothing)? Similarly, are these optimizations allowed to happen at runtime? I am just trying to get a