g++

error: ‘double’ is not a class, struct, or union type [closed]

帅比萌擦擦* 提交于 2019-12-20 02:58:14
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I've got this problem that I recieve o a very sensitive piece of code, it is supposed to store sets of 70 x,y coordonance in a nested vector and later

Increase stack size in OS X Lion

荒凉一梦 提交于 2019-12-20 02:32:40
问题 I need to do it for a C++ program that needs a lot of stack. I use g++ (included in OS X Lion) to compile it. How could I increase it for my program? 回答1: From http://developer.apple.com/library/mac/#qa/qa1419/_index.html Using gcc, pass link flags through to ld with -Wl: gcc -Wl,-stack_size -Wl,1000000 foo.c 回答2: You can use getrlimit / setrlimit - this works on Linux, Mac OS X, and other POSIX-ish operating systems, e.g. #include <sys/resource.h> int main (int argc, char **argv) { const

How to read in space-delimited information from a file in c++

半腔热情 提交于 2019-12-20 02:01:30
问题 In a text file I will have a line containing a series of numbers, with each number separated by a space. How would I read each of these numbers and store all of them in an array? 回答1: std::ifstream file("filename"); std::vector<int> array; int number; while(file >> number) { array.push_back(number); } 回答2: Just copy them from the stream to the array: #include <fstream> #include <vector> #include <algorithm> #include <iterator> int main() { std::ifstream file("filename"); std::vector<int>

Unable to execute Cython wrapped Python code

。_饼干妹妹 提交于 2019-12-19 21:46:45
问题 I am exporting C++ API for python code using Cython. The application will be executed on Ubuntu. The project files are present here The function I am wrapping, reads the file name of the image and displays the image. The Show_Img.pyx file looks as follows import cv2 cdef public void Print_image(char* name): img = cv2.imread(name) cv2.imshow("Image", img) while(True): if cv2.waitKey(1) & 0xFF == ord('q'): break The c++ interface generated from Cython looks as follows __PYX_EXTERN_C DL_IMPORT

C++: specializing member requires «template<>» syntax

徘徊边缘 提交于 2019-12-19 19:47:02
问题 What am I doing wrong? template<class T> class Binder { public: static std::vector< Binder< T >* > all; Node<T>* from; Node<T>* to; Binder(Node<T>* fnode, Node<T>* tonode) { from = fnode; to = tonode; Binder<T>::all.push_back(this); } }; std::vector<Binder<int>*> Binder<int>::all = std::vector< Binder<int>* >(); //here it is Thank you. 回答1: The definition of the static member is interpreted by the compiler as a specialization (actually, it is a specialization: you are giving a declaration

Missing symbols from static library in linked executable

主宰稳场 提交于 2019-12-19 19:42:33
问题 I have a problem with static library symbols missed in linked executable. Here is the description of my problem: I have static library built from several object files. These object files provides sevaral groups of symbols, associated with: A set of C functions and structs (several object files). Let's call corresponding symbols level1 symbols. A set of C++ wrapper classes for this C functions and structs (another object file). Let's call corresponding symbols level2 symbols. A set of C++

G++ cannot find boost library

十年热恋 提交于 2019-12-19 19:36:13
问题 I am not good in command-line compiling. My problem is inability to compile simple project, that depends from Boost. The following is a log of my trying: $ g++ -Wall test.cpp -o main /tmp/ccCTvBYE.o: In function `__static_initialization_and_destruction_0(int, int)': test.cpp:(.text+0x6b): undefined reference to `boost::system::generic_category()' test.cpp:(.text+0x77): undefined reference to `boost::system::generic_category()' test.cpp:(.text+0x83): undefined reference to `boost::system:

CMAKE_C_COMPILER is not a full path to an existing compiler tool

自作多情 提交于 2019-12-19 18:56:55
问题 I recently explored distcc and couldn't make it work. So I sudo apt-get remove distcc After that, I get the error ==> Processing catkin package: 'gencpp' ==> Building with env: '/opt/ros/kinetic/env.sh' Makefile exists, skipping explicit cmake invocation... ==> make cmake_check_build_system in '/home/pi/ros_catkin_ws/build_isolated/gencpp' -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:2 (project): The CMAKE_C_COMPILER:

CMAKE_C_COMPILER is not a full path to an existing compiler tool

风流意气都作罢 提交于 2019-12-19 18:56:35
问题 I recently explored distcc and couldn't make it work. So I sudo apt-get remove distcc After that, I get the error ==> Processing catkin package: 'gencpp' ==> Building with env: '/opt/ros/kinetic/env.sh' Makefile exists, skipping explicit cmake invocation... ==> make cmake_check_build_system in '/home/pi/ros_catkin_ws/build_isolated/gencpp' -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:2 (project): The CMAKE_C_COMPILER:

CMAKE_C_COMPILER is not a full path to an existing compiler tool

六眼飞鱼酱① 提交于 2019-12-19 18:56:27
问题 I recently explored distcc and couldn't make it work. So I sudo apt-get remove distcc After that, I get the error ==> Processing catkin package: 'gencpp' ==> Building with env: '/opt/ros/kinetic/env.sh' Makefile exists, skipping explicit cmake invocation... ==> make cmake_check_build_system in '/home/pi/ros_catkin_ws/build_isolated/gencpp' -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:2 (project): The CMAKE_C_COMPILER: