Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  make sendfirm
« previous next »
  • Print
Pages: [1]

Author Topic: make sendfirm  (Read 3956 times)

Offline robertdundee

  • Member
  • *
  • Posts: 24
make sendfirm
« on: December 11, 2014, 11:22:24 AM »
In the  directory ~/rockbox/utils/MTP$ I try to create sendfirm following the instructions. I write make but I get error 1. How can I fix this>

gcc  -Wall -lmtp -o sendfirm sendfirm.c
sendfirm.c: In function ‘sendfile_function’:
sendfirm.c:78:9: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
         exit(1);
         ^
sendfirm.c:78:9: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
sendfirm.c: In function ‘main’:
sendfirm.c:142:5: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
     exit(0);
     ^
/tmp/cchJ6DIx.o: In function `sendfile_function':
sendfirm.c:(.text+0x11d): undefined reference to `LIBMTP_new_file_t'
sendfirm.c:(.text+0x18e): undefined reference to `LIBMTP_Send_File_From_File'
sendfirm.c:(.text+0x1c0): undefined reference to `LIBMTP_Dump_Errorstack'
sendfirm.c:(.text+0x1cf): undefined reference to `LIBMTP_Clear_Errorstack'
sendfirm.c:(.text+0x1fa): undefined reference to `LIBMTP_destroy_file_t'
/tmp/cchJ6DIx.o: In function `main':
sendfirm.c:(.text+0x227): undefined reference to `LIBMTP_Init'
sendfirm.c:(.text+0x24a): undefined reference to `LIBMTP_Get_First_Device'
sendfirm.c:(.text+0x290): undefined reference to `LIBMTP_Release_Device'
collect2: error: ld returned 1 exit status
make: *** [sendfirm] Error 1

Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9136
Re: make sendfirm
« Reply #1 on: December 11, 2014, 11:25:06 AM »
Do you have libmtp installed? The linker can't find it.

Edit:  The wiki lists the dependencies:

Quote
The sendfirm utility is used to upgrade the firmware in an MTP device. It can be found in the utils/MTP directory in the Rockbox source tree; the Linux version requires both libusb and libmtp (and their development packages) to compile and use. This utility can be used from Linux and Windows.
For Linux: to compile, just type make in the utils/MTP directory.
For Windows: make sure you have MingW installed and type make sendfirm.exe in the utils/MTP directory (or download the binary here).

http://www.rockbox.org/wiki/GigabeatSInstallation#A_41_Compile_the_sendfirm_utility
« Last Edit: December 11, 2014, 11:47:49 AM by saratoga »
Logged

Offline robertdundee

  • Member
  • *
  • Posts: 24
Re: make sendfirm
« Reply #2 on: December 11, 2014, 05:21:09 PM »
Thank you. Yes, I have both libusb and libmtp installed. Im stuck on this part. Any advice is greatly appreciated
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9136
Re: make sendfirm
« Reply #3 on: December 11, 2014, 05:26:29 PM »
Do you have the development packages too (so that would be a total of 4 packages not 2).
Logged

Offline robertdundee

  • Member
  • *
  • Posts: 24
Re: make sendfirm
« Reply #4 on: December 11, 2014, 06:19:48 PM »
Yes, i do have all the packages installed in ubuntu
Logged

Offline pamaury

  • Developer
  • Member
  • *
  • Posts: 508
Re: make sendfirm
« Reply #5 on: December 13, 2014, 06:24:30 AM »
You probably have an old version of gcc which cares about the order when linking.
Try to edit the Makefile (at utils/MTP/Makefile) and replace this line:
Code: [Select]
gcc $(EXTRA_CFLAGS) $(CFLAGS) $(LIBS) -o $(OUTPUT) sendfirm.cby this line:
Code: [Select]
gcc $(EXTRA_CFLAGS) $(CFLAGS) -o $(OUTPUT) sendfirm.c $(LIBS)
Logged
Please don't PM me, use our IRC channel instead.

Offline robertdundee

  • Member
  • *
  • Posts: 24
Re: make sendfirm
« Reply #6 on: December 13, 2014, 06:33:35 AM »
Many thanks Pamaury !

~/rockbox/utils/MTP$ make
gcc  -Wall -o sendfirm sendfirm.c -lmtp
sendfirm.c: In function ‘sendfile_function’:
sendfirm.c:78:9: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
         exit(1);
         ^
sendfirm.c:78:9: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
sendfirm.c: In function ‘main’:
sendfirm.c:142:5: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
     exit(0);
     ^
« Last Edit: December 13, 2014, 07:17:23 AM by robertdundee »
Logged

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 398
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: make sendfirm
« Reply #7 on: December 13, 2014, 11:29:43 AM »
Quote from: robertdundee on December 13, 2014, 06:33:35 AM
Many thanks Pamaury !

~/rockbox/utils/MTP$ make
gcc  -Wall -o sendfirm sendfirm.c -lmtp
sendfirm.c: In function ‘sendfile_function’:
sendfirm.c:78:9: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
         exit(1);
         ^
sendfirm.c:78:9: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
sendfirm.c: In function ‘main’:
sendfirm.c:142:5: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
     exit(0);
     ^


Those are just minor warnings. If they really bother you, just add this line to the top of sendfirm.c:

Code: [Select]
#include <stdlib.h>
Logged
No support questions by PM, please.

Offline robertdundee

  • Member
  • *
  • Posts: 24
Re: make sendfirm
« Reply #8 on: December 14, 2014, 08:46:59 AM »
Thanks. When I try the make sendfirm.exe Im having the following problem>
mingw32-gcc -Wall -o sendfirm.exe sendfirm_win.c MTP_DLL.dll
make: mingw32-gcc: Command not found
make: *** [sendfirm.exe] Error 127
Logged

Offline pamaury

  • Developer
  • Member
  • *
  • Posts: 508
Re: make sendfirm
« Reply #9 on: December 14, 2014, 08:51:22 AM »
To compile sendfirm under Windows, you need the MingGW compiler which is not super easy to install. In this case I suggest you simply use the prebuilt version: https://www.dropbox.com/s/9vwc4qdyh0c6e0p/sendfirm.exe?dl=0 (note that this link is on the wiki page...)
Logged
Please don't PM me, use our IRC channel instead.

Offline robertdundee

  • Member
  • *
  • Posts: 24
Re: make sendfirm
« Reply #10 on: December 14, 2014, 08:56:57 AM »
Thank you Pamaury. I will do that
Logged

Offline gordonrgw

  • Member
  • *
  • Posts: 2
Re: make sendfirm
« Reply #11 on: December 03, 2019, 09:54:27 AM »
Thanks all,

I know this is 5 years later, but this sorted my make on Linux Mint 19.2 also..
Logged
Creative Zen X-Fi, iriver H10 5Gb, Creative Sleek Photo, iriver iHP-795

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  make sendfirm
 

  • SMF 2.0.18 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.083 seconds with 21 queries.