Category "c++"

C++: Undefined reference to Casadi

Here is my source code #include <casadi/casadi.hpp> int main(int argc, char** argv) { casadi::SX x = casadi::SX::sym("x"); return 0; } I use gcc v

C++ How to read/split EPRT command?

I am currently writing a C++ FTP server and I was wondering what would be the best way to read the EPRT command from the client. << DEBUG INFO. >>:

Permission Denied when trying to use open() with POSIX commands in C++

I currently have this code where I need to use standard POSIX calls to write text to a file: file = open(filename, O_CREAT | O_RDWR | O_APPEND, S_IRUSR | S_IWUS

Member specialization does not match any template declaration

The code below compiles except for the lines template <> std::map<std::string, std::function<Goo*(Foo*)>>& Factory::getMap<Goo, Foo*>

How to best design function that takes an unary predicate

I'm implementing a simple timeout-class which calls a given function when time runs out. However I'm scratching my head on how to make the function constructor

enforce typetrait for all subclasses

is there are a way I can check during compile time, that all subclasses of a given class satisfy a given typetrait? For example: I want to make sure that all cl

Console output giving unexpected number after a simple calculation? c++

This is an assignment that I am doing for university and I have not had many problems with assignments up until this point. I would expect my program to be work

Intel MKL for matrix multiplication when rows are not memory-contiguous

Our hardware is Intel Xeon Phi so we are encouraged to get the most out of it by replacing hand-written linear algebra ops (e.g. square matrix multiplications)

Problem with variables using a namespace at C++

I am trying to write a relativity big code. The main problem, for awhile, is that there is a problem occurring when I define a dictionary. I have a .hh file nam

convert cv::mat to IplImage

Mat m = Mat(4, 4, CV_8UC3); IplImage * iplImage = cvIplImage(m); error: cannot convert ‘_IplImage’ to ‘IplImage*’ {aka ‘_IplImage

How do I make my setfunction run through my if loop?

I am working on a program and I need to make a class about cars. I need to add setFunctions that only allow a car year manufacture of 1930 -2030 as input, anyth

odom and base_link frames are far - localization

I have an imu and gps only and i want use them for localization. I am using robot_localization ekf node. its setting is similar to this. when I view the tf on r

Best QWidget or item to use to display a variable in a box

I would like to ask which QWidget or which Qt GUI item would be best to use to display a variable that will change during the lifecycle of the program, in a box

Still can't use a function defined in a separate .cpp file

I've been searching through questions on this for hours, and it just isn't working for some reason, so sorry if there's already an answer and I just didn't unde

Execute an embeded exe with createprocess c++

I am trying to execute an exe file which is embedded in a buffer. I try to execute this exe file with createProcess (i think that this is possible) but i get th

Friend classes and header files

I am writing a C++ program where I wish to use a friend class in order to access protected members of another class. Here is the header for the class I wish to

Why do I get a heap buffer overflow simply by declaring a shared_ptr member variable?

Just ran into this very strange bug. I'm getting crashes due to memory errors after adding a new shared_ptr instance variable in an existing containing class.

Returning two AVX/AVX2 __m256d types in C++ function calls via registers

I am new to programming with the AVX/AVX2 instructions and am trying to optimize the speed of my code. Following the older expectation that passing by reference

How to concatenate two strings in C++?

I have a private class variable char name[10] to which I would like to add the .txt extension so that I can open the file present in the directory. How do I g

How to set cmake, in order to add txt files into working directory as resource?

CMakeLists.txt cmake_minimum_required(VERSION 3.8) project(untitled) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES main.cpp) add_executable(untitled ${SOURCE_F