facine / easyBlack

Beaglebone Black C++ Library for GPIO using high performance of mmap.
MIT License
17 stars 7 forks source link

nullptr for arm-linux-gnueabihf-g++ #1

Open bremenpl opened 9 years ago

bremenpl commented 9 years ago

Hello there, I would like to use your library in my project. I am using QT Creator and arm-linux-gnueabihf-g++ (gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux) for compiling and deploying programs to BeagleBone Black. The problem I faced is that my compiller doesnt know the nullptr. Could you please tell me what version are you using?

facine commented 9 years ago

Hello, try with flag -std=gnu++0x or adding

ifndef nullptr

define nullptr 0

endif

bremenpl commented 9 years ago

The flag doesnt help I tried it before. I have found a workaround for nullptr here:

http://stackoverflow.com/questions/2419800/can-nullptr-be-emulated-in-gcc

Then the only problem i got left (apart from thausands of warnings) is that to_string is not a part of std :|. Do you maybe know how to overcome this?

bremenpl commented 9 years ago

Could please tell me what cross-compiller are you using? I tried to add the c++ 11 flags to linaro gcc, this is my version:

arm-linux-gnueabihf-g++ (crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 4.7.3 20130328 (prerelease)

I get about 600 warnings when compiling demo program you demonstrated. I firstly had to make a nullptr object and then I got error that std doesnt have member to_string, so I had to remove the function that is using it. I would really aprichiate your help.