Results 1 to 6 of 6

Thread: malloc no declared error on compile of ros.pde

  1. malloc no declared error on compile of ros.pde

    Hi there. I am trying to get arduino 0018 to compile the ros.pde file (running on Ubuntu Precise) and I am getting the follow errors.
    Any help would be appreciated.

    As an aside question. I dropped back to using arduino 0018 as I could not get arduino 1.0.1 to compile either. the ros/arbotix stack install explicilty states to use arduino version 0018. Is that because arduino 1.0.1 is not compatile with the lates arbotix firmware under fuerte?

    Thanks,
    -Scott
    /home/scott/arduino-0018/libraries/Bioloid_orig/BioloidController.cpp: In constructor ‘BioloidController::BioloidController(long int)’:

    /home/scott/arduino-0018/libraries/Bioloid_orig/BioloidController.cpp:29:75: error: ‘malloc’ was not declared in this scope

    /home/scott/arduino-0018/libraries/Bioloid_orig/BioloidController.cpp: In member function ‘void BioloidController::setup(int)’:

    /home/scott/arduino-0018/libraries/Bioloid_orig/BioloidController.cpp:49:69: error: ‘malloc’ was not declared in this scope

  2. #2
    Join Date
    May 2008
    Posts
    2,228
    Images
    155
    Rep Power
    132

    Re: malloc no declared error on compile of ros.pde

    The instructions haven't been updated in a while -- yes, you can't use 1.0 or higher (yet). Should work up to 0023.

    As for no malloc -- I've never seen this before, and can't seem to find any references to what might have changed in avr-libc. Can you try not renaming the Bioloid folder to Bioloid_orig (this might be messing with the makefile generation that the Arduino IDE does, but I'm kinda just guessing here at things that could be wrong).

    -Fergs

  3. #3
    Join Date
    Jun 2011
    Location
    USA
    Posts
    547
    Images
    107
    Rep Power
    48

    Re: malloc no declared error on compile of ros.pde

    I'm just guessing here, as I've never worked with the Arduino libraries... but I recently had to do an #include <malloc.h> for the TI chip based Wixel (rather than an AVR chip based thingy). You might get around the errors by manually including whatever header file defines the malloc function in the Arduino libraries.

    (Caveat; my code for my Wixel project compiles, but is not fully functional yet)
    (If this is dumb, some pro should tell me so)

  4. Re: malloc no declared error on compile of ros.pde

    Thanks for the replies. I will try to to with arduino 0023 on a fresh install of ubuntu 11.10 and ros fuerte and see how it goes.
    Updates to follow! Thanks again!

  5. Re: malloc no declared error on compile of ros.pde

    OK I am making progress and this is where I am stuck now. (posted to ros answers as well)

    I am running Ubuntu 11.10 with latest Fuerte install and arduino 0023 I have followed all the instructions on the websites and I am not getting any malloc errors now, but when I try to compile the ros.pde sketch I get the following errors. Any help would be appreciated.

    ros.cpp: In function ‘int handleRead()’:
    ros.cpp:238:21: error: ‘BYTE’ was not declared in this scope
    ros.cpp: In function ‘void statusPacket(int, int)’:
    ros.cpp:266:21: error: ‘BYTE’ was not declared in this scope
    ros.cpp: In function ‘void loop()’:
    ros.cpp:325:33: error: ‘BYTE’ was not declared in this scope
    ros.cpp:472:31: error: ‘BYTE’ was not declared in this scope
    ros.cpp:513:48: error: ‘BYTE’ was not declared in this scope

  6. Re: malloc no declared error on compile of ros.pde

    OK I found the fix from a related posting on a sparkfun site, apparently BYTE has been depricated in the Serial package
    http://forum.sparkfun.com/viewtopic.php?f=32&t=30991
    Thus Serial.print(value, BYTE);
    need to be replaced with:
    Serial.write(value);

    So to fix this, edit the ros.pde file and remove all BYTE entries, (after backing it up first) then save it and it compliles perfectly!
    -Scott

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. error - not available
    By cillaelery in forum Garage Sale
    Replies: 0
    Last Post: 05-06-2012, 12:05 AM
  2. Question(s) error 8100 on CM-2+
    By carlos067 in forum Software and Programming
    Replies: 4
    Last Post: 06-18-2009, 12:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •