vancegroup/stlport-avr

Compile errors using Arduino IDE 1.6.1 with Mega

Closed this issue · 2 comments

Been attempting to get stlport and Eigen 3.0 working on the Mega but am receiving the following error using that simple sketch on the wiki page. This is also using 5.2-Arduino installed branch:

C:\Local Programs\arduino-1.6.1/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10601 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Local Programs\arduino-1.6.1\hardware\arduino\avr\cores\arduino -IC:\Local Programs\arduino-1.6.1\hardware\arduino\avr\variants\mega -IC:\Users\CyberMerln\Documents\Arduino\libraries\stlport C:\Users\CYBERM1\AppData\Local\Temp\build4751032195296447181.tmp\sketch_jun27a.cpp -o C:\Users\CYBERM1\AppData\Local\Temp\build4751032195296447181.tmp\sketch_jun27a.cpp.o

sketch_jun27a.ino:3:19: fatal error: cstdint: No such file or directory
compilation terminated.
Error compiling.

UPDATED: As a test I also just tried the master arduino installed branch and received the following error messages:
Arduino: 1.6.1 (Windows 7), TD: 1.21, Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Using library stlport in folder: C:\Users\CyberMerln\Documents\Arduino\libraries\stlport (1.0.x format)

C:\Local Programs\arduino-1.6.1/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10601 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Local Programs\arduino-1.6.1\hardware\arduino\avr\cores\arduino -IC:\Local Programs\arduino-1.6.1\hardware\arduino\avr\variants\mega -IC:\Users\CyberMerln\Documents\Arduino\libraries\stlport C:\Users\CYBERM1\AppData\Local\Temp\build4751032195296447181.tmp\sketch_jun27a.cpp -o C:\Users\CYBERM1\AppData\Local\Temp\build4751032195296447181.tmp\sketch_jun27a.cpp.o

In file included from C:\Users\CyberMerln\Documents\Arduino\libraries\stlport/new:24:0,
from C:\Users\CyberMerln\Documents\Arduino\libraries\stlport/stl/_alloc.h:44,
from C:\Users\CyberMerln\Documents\Arduino\libraries\stlport/vector:36,
from sketch_jun27a.ino:2:

C:\Users\CyberMerln\Documents\Arduino\libraries\stlport/stl/_new.h:149:24: fatal error: new: No such file or directory

include_next

                    ^

compilation terminated.

Error compiling.

Really would like to get this working so any help would be appreciated.

thanks in advance
Mike

I would try to hunt around to see if you're missing an include directory. Perhaps this would help?

http://stackoverflow.com/questions/6650672/android-external-stlport-include-in-android-mk-build-not-successfull

Turned out that there was two missing files from the 5.2-arduino-installed both related to cstint. Copied over from the master branch but received the following errors using the example sketch:

sketch_jun27a.cpp.o: In function __stl_new': C:\Users\CyberMerln\Documents\Arduino\libraries\stlport/stl/_new.h:170: undefined reference tostd::__node_alloc::_M_allocate(unsigned int&)'
sketch_jun27a.cpp.o: In function __stl_delete': C:\Users\CyberMerln\Documents\Arduino\libraries\stlport/stl/_new.h:171: undefined reference tostd::__node_alloc::_M_deallocate(void*, unsigned int)'
collect2.exe: error: ld returned 1 exit status
Error compiling.

For the heck of it decided to try it with EigenArduino example to see what errors I got using the following sketch:

#include <stlport.h>
#include <vector>
#include <Eigen30.h>


using Eigen::MatrixXd;

MatrixXd m(2, 2);

void setup()
{
     Serial.begin(115200);

  /* add setup code here */
     m(0, 0) = 3;
     m(1, 0) = 2.5;
     m(0, 1) = -1;
     m(1, 1) = m(1, 0) + m(0, 0);

}

void loop()
{

  /* add main program code here */
     Serial.println(m(1,1));
     delay(2000);
}

This sample worked fine - so have to now learn more c++.

Thanks for your help.

Mike