lvgl / lv_port_win_codeblocks

Windows PC simulator project for LVGL embedded GUI Library
MIT License
129 stars 79 forks source link

After Selecting Type "Console application" compile errors comes #8

Closed manjeetparjapati closed 3 years ago

manjeetparjapati commented 3 years ago

Hi, Great Lib , Thankyou so much for lib. I have successfully run PC simulation using Code::Blocks 20.03. I want to printf output in console for below code (its for example).

include

include

static void my_event_cb(lv_obj_t * obj, lv_event_t event) { switch(event) { case LV_EVENT_PRESSED: printf("Pressed\n"); break; case LV_EVENT_CLICKED: printf("Clicked\n"); break; } }

for that I have made some steps project LittlevGL-> right click , then "Properties...", then Tab "Build targets", then change "Type"= "GUI application to Console application"

after above steps , I "Rebuild" the project , now its shows some errors

lv_drivers\win_drv.c|218|undefined reference to CreateBitmap@20'| lv_drivers\win_drv.c|223|undefined reference toCreateCompatibleDC@4'| lv_drivers\win_drv.c|224|undefined reference to SelectObject@8'| lv_drivers\win_drv.c|226|undefined reference toBitBlt@36'| lv_drivers\win_drv.c|228|undefined reference to SelectObject@8'| lv_drivers\win_drv.c|229|undefined reference toDeleteDC@4'| lv_drivers\win_drv.c|232|undefined reference to `DeleteObject@4'| ||error: ld returned 1 exit status| ||=== Build failed: 8 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

if I reverse all steps back project LittlevGL-> right click , then "Properties...", then Tab "Build targets", then change "Type"= " Console application to GUI application" Simulation works fine, but no console or printf text.

Please help me out... I want to check events call function by using console.. Or any other method for checking this please mention. Thanks

embeddedt commented 3 years ago

CodeBlocks has turned out to be a strange IDE for Windows development. Keep it in console mode, but try adding gdi32 to the list of libraries to link to (let me know if you need help finding that).

manjeetparjapati commented 3 years ago

CodeBlocks has turned out to be a strange IDE for Windows development. Keep it in console mode, but try adding gdi32 to the list of libraries to link to (let me know if you need help finding that).

Its working now, thanks a lot, you are great 👍. And thanks again for library and simulation.

embeddedt commented 3 years ago

You're welcome! Glad I could help.