Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: natanelho on December 01, 2014, 08:38:49 PM

Title: a few questions about compilation
Post by: natanelho on December 01, 2014, 08:38:49 PM
1. I instaled the cross compiler correctly, i saw the guides, but i cant understand why the helloworld.c isnt compiled.
2.how to compile? i dont know where to put my *.c file in order to get the rock in the zip(after make zip)

i have tried to program in lua, and i have a few questions.
3.when im using "rb.do_menu" function, the menu apears and the title of it has an icon of tools next to it. can i change it to other icon?
4.I need to use the sqrt func(square root), but when i used it it says that it returned nil value. what to do?
5. after building the ui simulator, it said that it dont has the .rockbox folder, so i putted it from the zip i compiled. now i cant use any plugin inside the simulator. any sugestions?
Title: Re: a few questions about compilation
Post by: saratoga on December 02, 2014, 11:31:47 AM
Heres the ones I know:

1)  Most likely it has to be added to the SOURCES files in the same folder.  SOURCES tells the compiler which files actually get built for which devices. 
2)  See above.

4)  I don't think there is floating point support in lua (or rockbox in general), so functions that require floats probably aren't available.
5)  You have to actually compile a build for the sim, you can't use a build compiled for a device.  There is a simple short cut to automate installing builds on the sim:  'make install' which i believe does a make, a make zip and then unzips it to the uisimulator folder.
Title: Re: a few questions about compilation
Post by: natanelho on December 02, 2014, 03:57:24 PM
where to run the make install from?
Title: Re: a few questions about compilation
Post by: saratoga on December 02, 2014, 03:58:35 PM
The build directory. Same as any other make command.
Title: Re: a few questions about compilation
Post by: __builtin on December 02, 2014, 04:52:11 PM
4)  I don't think there is floating point support in lua (or rockbox in general), so functions that require floats probably aren't available.

There is fixedpoint.h that provides fixed-point implementations of some mathematical functions (log, sqrt, trig).

1)  Most likely it has to be added to the SOURCES files in the same folder.  SOURCES tells the compiler which files actually get built for which devices. 

For your specific situation, you probably want to just uncomment helloworld.c in apps/plugins/SOURCES.

3.when im using "rb.do_menu" function, the menu apears and the title of it has an icon of tools next to it. can i change it to other icon?

I believe this is theme-specific, so you shouldn't (but probably could) change it from a plugin.