Results 1 to 4 of 4

Thread: Bioloid C programming: including libCM-5.a in makefile

  1. Bioloid C programming: including libCM-5.a in makefile

    This may seem mundane to experienced programmers, but I am a mechanical engineering student trying to figure out programming the Bioloid robots in C. I know the basics of C programming, but the makefile is a mystery to me. I am using WinAVR to make the program.

    I've been following the Robotis Expert Manual and it instructed to include the following lines in the makefile:
    under #additional libraries:
    ROBOTIS_LIB = -lCM-5 -L../../lib
    and under #Linker flags:
    LDFLAGS += $(ROBOTIS_LIB)

    I have both the libCM-5.h and the libCM-5.a files, but I don't really know where to put them to make this work. so far I just have them in the same file as the C file "bioloidattempt1." Each time I hit "Make All" it gives me the following:

    Linking: Bioloidattempt1.elf
    avr-gcc -mmcu=atmega128 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=bioloidmain.o -std=gnu99 -Wp,-M,-MP,-MT,Bioloidattempt1.o,-MF,.dep/Bioloidattempt1.elf.d bioloidmain.o --output Bioloidattempt1.elf -Wl,-Map=Bioloidattempt1.map,--cref -lm lCM-5 -L../../lib
    avr-gcc: lCM-5: No such file or directory
    make.exe: *** [Bioloidattempt1.elf] Error 1
    > Process Exit Code: 2
    > Time Taken: 00:00

    If anyone can give me some advice on where to put both files and the code to insert into the makefile, I would appreciate it!

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

    Re: Bioloid C programming: including libCM-5.a in makefile

    Quote Originally Posted by tjo5010 View Post
    This may seem mundane to experienced programmers, but I am a mechanical engineering student trying to figure out programming the Bioloid robots in C. I know the basics of C programming, but the makefile is a mystery to me. I am using WinAVR to make the program.

    I've been following the Robotis Expert Manual and it instructed to include the following lines in the makefile:
    under #additional libraries:
    ROBOTIS_LIB = -lCM-5 -L../../lib
    and under #Linker flags:
    LDFLAGS += $(ROBOTIS_LIB)

    I have both the libCM-5.h and the libCM-5.a files, but I don't really know where to put them to make this work. so far I just have them in the same file as the C file "bioloidattempt1." Each time I hit "Make All" it gives me the following:

    Linking: Bioloidattempt1.elf
    avr-gcc -mmcu=atmega128 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=bioloidmain.o -std=gnu99 -Wp,-M,-MP,-MT,Bioloidattempt1.o,-MF,.dep/Bioloidattempt1.elf.d bioloidmain.o --output Bioloidattempt1.elf -Wl,-Map=Bioloidattempt1.map,--cref -lm lCM-5 -L../../lib
    avr-gcc: lCM-5: No such file or directory
    make.exe: *** [Bioloidattempt1.elf] Error 1
    > Process Exit Code: 2
    > Time Taken: 00:00

    If anyone can give me some advice on where to put both files and the code to insert into the makefile, I would appreciate it!
    I've not programmed the CM-5 using AVR-GCC (I've never actually fired up my CM-5)... but, the -L../../lib means you should have your .a file up two directories in a diretory called lib (.. = up a directory)

    -Fergs

  3. Re: Bioloid C programming: including libCM-5.a in makefile

    Thanks Fergs!
    Actually that helped a lot. I didnt know what that meant, but now that i know i was able to find the file and insert the library. It compiles with no errors now.

    Thanks again,
    Trev

  4. #4
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    173

    Re: Bioloid C programming: including libCM-5.a in makefile

    You can also give it an explicit location to start the search for the library from: -L/foo/bar/my/directory/lib
    I Void Warranties´┐Ż

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. C# Bioloid Motion Sequence Program
    By DresnerRobotics in forum Mech Warfare
    Replies: 4
    Last Post: 11-25-2009, 04:55 AM
  2. programming RoboBuilder in C
    By JoeStrout in forum Humanoids, Walkers & Crawlers
    Replies: 5
    Last Post: 10-30-2008, 09:23 AM
  3. programming axon with a-d converter
    By robot maker in forum Software and Programming
    Replies: 21
    Last Post: 07-31-2008, 04:52 PM
  4. Discussion C Programming Recommendations
    By Alex in forum Software and Programming
    Replies: 13
    Last Post: 07-27-2008, 01:11 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
  •