Questions tagged [c++]

For questions pertaining to compiling c++ programs on the Raspberry Pi.

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. This tag is for questions about the use of C++ on the Raspberry Pi.

261 questions
2
votes
1 answer

memory trouble compiling c++ on the rpi3b+

The compiler works great, there are 4 cores available, but if I use all 4 of them, invariably the memory runs out. Aside from uninstalling as many services as possible, compiling with a cross-compiler and skipping on the GUI/IDE, what can one do?
user1095108
  • 239
  • 1
  • 9
2
votes
1 answer

Removing a delay function while capturing image using c++ API for picamera gives me completely black jpeg images

I am working on reducing the image capturing time for pi camera module ..and I found out a way of capturing the image within 10 ms using a c++ API This the my main program from where I try to capture an image class Timer { private: …
user5049377
  • 53
  • 1
  • 5
1
vote
1 answer

C++ Qt5 / OpenGL issue when compiling a program that uses glGetTexImage()

I am on latest Raspian release with latest Qt5 pkgs and related OpenGL + MESA pkgs installed from the standard Raspian repo. I am attempting to build a C++ program (not mine) that relies on Qt5 and OpenGL. The compiler is complaining as…
Leon Shaner
  • 144
  • 7
1
vote
1 answer

Beginner C++ Books on using Raspberry Pi

There seems to be a shortage of books out there on using C++ with Raspberry Pi! I could literally only spot two, which I will paste…
Curious
  • 21
  • 2
1
vote
1 answer

Simple C++ program compiles but does not run

Having installed the g++ compiler, I thought I might finally be allowed to do some C++ rather than Python on my Pi. Not so though, as my program does not run. It compiles fine, with no errors, and having checked the file explorer it definitely…
imulsion
  • 751
  • 4
  • 10
  • 19
1
vote
1 answer

I cannot run my cpp file to connect mysql in my raspberry pi card

i have a project in Netbeans to connect to Mysql which is in my Raspberry pi card. so the example code i found is: #include #include // using namespace std; //…
1
vote
2 answers

Process terminate with SIGILL using valgrind

I tried to use valgrind in order to debug some memory corruption, but when I run the program to debug using valgrind it ends reporting Illegal instruction. So I tried with this very simple code : #include int main() { std::cout <<…
mpromonet
  • 1,124
  • 18
  • 37
0
votes
1 answer

Can I use, in a friend function, an object created in class constructor?

#include "MPU6050.h" class DATA{ public: DATA(int A); void Sensor(); } DATA::DATA(int A){ MPU6050 mpu(A); } void Sensor(){ mpu.setFullScaleAccelRange(3); // the problem is here, "mpu" object is not declared for this friend…
Digol
  • 173
  • 10
0
votes
1 answer

Why ArduPi library does not work?

I tried to use arduPi library and I did what this page says : https://www.cooking-hacks.com/documentation/tutorials/raspberry-pi-to-arduino-shields-connection-bridge#step4 but I do not know what is wrong with it ? I tried to run arduPi.cpp file but…
test me
  • 125
  • 1
  • 1
  • 6
0
votes
2 answers

Raspberry Pi 4 B g++ undefined reference to boost::system::system_category()

I created a simple program in C++ on my RPi to test the Boost library. This is the code: #include #include int main() { std::cout << "Hello World!" << std::endl; std::cout << "Opening TCP socket on port 9999..."…
Logan
  • 3
  • 2