Sting Posted August 15, 2016 Report Posted August 15, 2016 I am changing my ways, attempting to build projects in a shell using the makefile templates provided in the boards directory. I am using cross compiling to an armv7, an Arm Cortex-A8 processor on a beaglebone black. I built a new gmake_script for the board, any would have worked that have blank entries for SRCFLAGS and LDFLAGS. I took the makefile from the ugfx_2.6/boards/base/Linux-Framebuffer and copied to a directory where I wanted to build my project. I modified it as follows to use the X driver: # General settings # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables OPT_OS = linux # Change this next setting (or add the explicit compiler flags) if you are not compiling for x86 linux OPT_CPU = armv7 # uGFX settings # See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables GFXLIB = /usr/local/arm/ugfx_2.6 GFXBOARD = Linux-Framebuffer GFXDEMO = modules/gdisp/basics # Linux settings # See $(GFXLIB)/tools/gmake_scripts/os_linux.mk for the list of variables ############################################################################################## # Set these for your project # ARCH = arm-linux-gnueabihf- SRCFLAGS = CFLAGS = CXXFLAGS = ASFLAGS = LDFLAGS = SRC = OBJS = DEFS = # list of libraries to include LIBS = X11 xcb Xau Xdmcp # strange place where I put the X includes INCPATH = /usr/local/arm/project/include # strange place where I put the X libs LIBPATH =/usr/local/arm/project/lib /usr/local/arm/arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf ############################################################################################## # These should be at the end # # Added as instructed in the X driver readme # Note the readme is wrong as it calls for gdisp_ll_X.mk instead of driver.mk include $(GFXLIB)/gfx.mk include $(GFXLIB)/drivers/multiple/X/driver.mk include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk # *** EOF *** I added a few thinks to the local .gfxconf.h #ifndef _GFXCONF_H #define _GFXCONF_H /* The operating system to use. One of these must be defined - preferably in your Makefile */ #define GFX_USE_OS_LINUX TRUE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GINPUT TRUE #define GINPUT_USE_MOUSE TRUE #define GDISP_NEED_MULTITHREAD TRUE #define GDISP_SCREEN_WIDTH 640 #define GDISP_SCREEN_HEIGHT 480 /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE #endif /* _GFXCONF_H */ when I build it I get: Linking .build/ATest .build/obj/GFXLIB/drivers/multiple/X/gdisp_lld_X.o:(.rodata+0x0): multiple definition of `GDISPVMT_OnlyOne' .build/obj/GFXLIB/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.o:(.rodata+0x0): first defined here .build/obj/GFXLIB/drivers/multiple/X/gdisp_lld_X.o: In function `gdisp_lld_init': gdisp_lld_X.c:(.text+0x208): multiple definition of `gdisp_lld_init' For everything including main from the demo directory. There has to be something I didn't do but I can't see it.
Joel Bodenmann Posted August 15, 2016 Report Posted August 15, 2016 Your problem is that you are both including a premade board file by using the GFXBOARD variable while also manually including the X driver further down below. That won't work. You have to either use the framebuffer driver or either use the X driver (unless you setup multiple displays support but that is most likely not what you are after). If you want to use the X driver you have to set the GFXBOARD variable to Linux if you are running µGFX 2.6. HOWEVER, please read the rest of the message before you do so. The X driver has been deprecated a few minutes ago If you want to use the framebuffer driver you have to set the GFXBOARD variable to Linux-Framebuffer. You are not supposed to manually include any driver if you are using pre-made board files. Note that you would use the X driver if you want to run a µGFX driver inside X (eg. inside a desktop environment). You would use the framebuffer driver if your Linux system doesn't have X or a desktop environment system but rather just a kernel provided framebuffer. Right now at this moment we are extending the Linux documentation. Our community member @olegator contributed an SDL driver which VASTLY improves the performance of rendering a µGFX application on a Linux system that is capable of running SDL (eg. when you're having a desktop environment). If you are running a Linux distribution on your BeagleBone that can run SDL we strongly recommend using the new SDL driver. You can find more information in the documentation (that we are currently updating as we speak): https://wiki.ugfx.io/index.php/Linux Note that we also cleaned up the Linux board files section. You might want to have a look at the repository to grab the latest example Makefiles and drivers: https://git.ugfx.io/ugfx/ugfx Update: The new SDL driver has been officially added:
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now