How to compile sample project in linux or windows to armv61?

Hello everyone i am using arm1176 and trying to use lvgl.
cpu has 300mhz core, works on Raspbian GNU/Linux 8 (jessie)

and i am coding on windows + linux (virtual mint cinnamon) in vscode
ive tried sample project in eclipse (pc simulator) - works on 64bit x86 fine, but i cant cross compile it
also linux frame buffer example works on arm1176, but i cant compile it from my pc, so i need to compile it on slow soc and it tooks a lot of time.

ive tried to edit makefile to compile project on pc (added toolchain string)
part of makefile**
LDFLAGS ?= -lSDL2 -lm
BIN = demo
TOOLCHAIN := arm-linux-gnueabihf-
end part of makefile**

part of makefile**
default: $(AOBJS) $(COBJS) $(MAINOBJ)
$(TOOLCHAIN) $(CC) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(LDFLAGS)
end part of makefile**

but ive got errors
so what should i do to compile lvgl project in linux 64 or win64 to use in arm32 ?

To compile with SDL your toolchain must contain the SDL reference from the target (AKA .so for linux or .dll for windows).

Since you are working with Raspian, I suggest using the framebuffer instead and getting the linaro Cross Compiler, since it comes with enviroment variables that match with the Makefile from the lvgl demos.
If you are in linux, just

. /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi

before running make and it should work. Maybe you will need to change the LDFLAGS to

LDFLAGS += -lSDL2 -lm
        ^

Alternatively, you can get a cross compiler with the enviroment-setup for the Raspberry target.

You can simulate the screen with SDL on Windows and change the lv_config.h and lv_drv_config.h to run the same code on Linux Framebuffer.

No idea if this exists for Raspbian, but for ev3dev (Debian on the Lego EV3) they provide a Docker image with the needed ARM libraries and cross compiler. Perhaps check if something similar exists.

update. ok guys thanks for replies, as i said i am using armv6(32bit) on debian8 jessie (i cant install another linux on it.for compile files on it.
also i need to use gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf toolchain or ARM will say wrong binary… so ive installed debian 8 virtual machine on pc to get almost same environment. So i have almost the same compiler and it gives me error when i am tryin to compile sample frame buffer project.

ive got git project with recursive key. also ive installed sdl2 and gcc (Debian 4.9.2-10+deb8u2) 4.9.2

so when i am trying to perform make command there is a lot of errors (seems compiler is old or i dont know)

gcc: error: unrecognized command line option ‘-Wshift-negative-value’
ive deleted this key from makefile
and comipler gives me a lot of warnings
warning: “STDC_VERSION” is not defined [-Wundef]
#if STDC_VERSION >= 199901L // If c99 or newer, use stdint.h to determine arch size

to prevent this ive added -std=c11 key to CFLAGS

ive got cc1: warning: unrecognized command line option “-Wno-discarded-qualifiers”
so ive deleted this key

also ive got
warning: enumeration value ‘_LV_THEME_BUILTIN_LAST’ not handled in switch [-Wswitch-enum]
warning: no previous prototype for ‘custom_tick_get’ [-Wmissing-prototypes]
warning: unrecognized command line option “-Wno-discarded-qualifiers”
warning: (near initialization for ‘value_act.ch’) [-Wmissing-braces]
warning: missing braces around initializer [-Wmissing-braces]
main.c:46:10: warning: no previous prototype for ‘custom_tick_get’ [-Wmissing-prototypes]

but then ive tried arm-linux-gnueabihf-gcc
and got a lot of warnings…
main.c:46:10: warning: no previous prototype for ‘custom_tick_get’ [-Wmissing-prototypes]
cc1: warning: unrecognized command line option “-Wno-discarded-qualifiers”
lv_theme_template.c:387:5: warning: enumeration value ‘_LV_THEME_BUILTIN_LAST’ not handled in switch [-Wswitch-enum]
warning: (near initialization for ‘value_act.ch’) [-Wmissing-braces]

ok got it compiled on x64 linux and file became x64. then ive added -m32 key to make 32bit binary
but got error /usr/include/features.h:374:25: fatal error: sys/cdefs.h: (no such file)
ive performed apt-get install libc6-dev-i386
then ive got

usr/bin/ld: i386 architecture of input file `./main.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_group.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_indev.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_disp.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_obj.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_refr.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_style.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_debug.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_hal_disp.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_hal_indev.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_hal_tick.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_arc.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_bar.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_checkbox.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_cpicker.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_dropdown.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_keyboard.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_line.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_msgbox.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_spinner.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_roller.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_table.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_tabview.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_tileview.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_btn.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_calendar.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_chart.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_canvas.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_gauge.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_label.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_list.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_slider.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_textarea.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_spinbox.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_btnmatrix.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_cont.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_img.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_imgbtn.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_led.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_linemeter.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_page.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_switch.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_win.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_objmask.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_fmt_txt.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_12.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_14.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_16.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_18.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_20.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_22.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_24.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_26.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_28.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_30.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_32.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_34.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_36.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_38.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_40.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_42.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_44.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_46.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_48.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_12_subpx.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_28_compressed.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_unscii_8.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_dejavu_16_persian_hebrew.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_area.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_task.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_fs.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_anim.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_mem.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_ll.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_color.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_txt.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_txt_ap.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_math.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_log.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_gc.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_utils.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_async.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_printf.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_bidi.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_txt_ap.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_theme.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_theme_material.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_theme_mono.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_theme_empty.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_theme_template.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_mask.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_blend.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_rect.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_label.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_line.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_img.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_arc.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_draw_triangle.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_img_decoder.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_img_cache.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_img_buf.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_gpu_stm32_dma2d.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `fbdev.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `monitor.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `R61581.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `SSD1963.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `ST7565.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `UC1610.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `SHARP_MIP.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `FT5406EE8.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `keyboard.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `mouse.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `mousewheel.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `evdev.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `libinput.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `XPT2046.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `win_drv.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `img_cogwheel_alpha16.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `img_cogwheel_argb.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `img_cogwheel_chroma_keyed.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `img_cogwheel_indexed16.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_12_compr_az.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_16_compr_az.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_font_montserrat_28_compr_az.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `lv_demo_widgets.o' is incompatible with i386:x86-64 output
lv_printf.o: In function `_vsnprintf.constprop.0':
lv_printf.c:(.text+0xf25): undefined reference to `__udivdi3'
lv_printf.c:(.text+0xf55): undefined reference to `__umoddi3'
lv_printf.c:(.text+0xf85): undefined reference to `__udivdi3'
lv_printf.c:(.text+0xfb5): undefined reference to `__umoddi3'
lv_printf.c:(.text+0x1005): undefined reference to `__udivdi3'
lv_printf.c:(.text+0x1035): undefined reference to `__umoddi3'
lv_printf.c:(.text+0x1065): undefined reference to `__udivdi3'
lv_printf.c:(.text+0x108d): undefined reference to `__umoddi3'
/usr/bin/ld: demo(.eh_frame): relocation ".text+0x0 (type R_386_PC32)" goes out of range
/usr/bin/ld: lv_group.o: file class ELFCLASS32 incompatible with ELFCLASS64
/usr/bin/ld: final link failed: Wrong file format
collect2: error: ld returned 1 exit status

so anybody can help me to compile this thing?

ive tried to compile in windows and i have problems with sdl2 library

cannot find -lSDL2

so anybody knows how to add includes in windows to sdl2?
ive already downloaded sdl2-devel-2.0 mingw, but i am douing something wrong.

tried to install msys32 and so on,… cant force sdl2 to include in project.

turned off sdl2 in makefile and got compiled project on windows for armv6. but how to enable sdl2 ?

this code compiles wrongly.

static lv_color_t needle_colors[2] = {LV_COLOR_RED, LV_COLOR_BLUE};
            obj = lv_gauge_create(main_page, NULL);
            lv_gauge_set_needle_count(obj, 2, needle_colors);
            lv_gauge_set_value(obj, 0, 30);
            lv_gauge_set_value(obj, 1, 60);
            lv_page_focus(main_page, obj, LV_ANIM_ON);
            auto_del(obj, TIME_STEP * 2 + 16);
lv_examples/src/lv_demo_stress/lv_demo_stress.c:303:13: error: initializer element is not constant
             static lv_color_t needle_colors[] = {LV_COLOR_RED, LV_COLOR_BLUE};
             ^
lv_examples/src/lv_demo_stress/lv_demo_stress.c:303:13: error: (near initialization for 'needle_colors[0]')

as i see this was done to convert colors between different color bit systems. but how to fix this?