First off - this does not sound like a fltk question? This sounds like a general question about cross-compilation. There are far better resources than this out on the web that will guide you through the process of setting up an arm cross-compilation environment; you should read those first!
On 26 Apr 2011, at 05:18, lakshmi latha wrote: > I am trying to cross compile fltk for arm architecture ( AT91sam9263 ) from > linux host > I have downloaded cross compilers arm-2010.09-5, arm-2007.q1 & tried to > cross compile. error Can't find X11 libraries is displayed. OK, so it sounds like you either do not have, or have not correctly set the paths for, the necessary (cross compiled) libraries for X11 in your build environment. How much experience do you have of cross-compiling applications? I'm going to assume that it is all new, so if what follows is obvious to you, I apologise: It is not enough to have just a cross-compiler; you also need a complete set of all the libraries that will exist in your target environment, cross-compiled. This will consist of *at least* a C library (either glibc or similar, I often favour newlib for this) and the binutils tools, X11 and probably libz, libpng, libjpeg, openGL, etc., etc... It's a long list. If your target environment is unusual or custom, it is possible to build all these dependencies yourself from scratch using the sources, but it can be very time consuming... So, what board are you using? What support tools does the board vendor suggest? That is probably the easiest path. What OS is running on your target board? I assume some linux flavour, so who built the kernel? They must have usable libc libs etc to use, can you use them? Is the X11 running on the target already? How was it compiled, is that build environment available to you? Anyway, worst case, and you can't get the libs you need pre-built somewhere else, it more or less goes like this: - Bootstrap a (recent) gcc version, building only the C compiler, as a cross compiler, on your host machine. - Use this to build cross versions of your libc (either glibc or newlib or etc) and binutils. - Go back to the compiler and rebuild it against your new cross libc with your new binutils, and also build the C++ and any other compiler personalities you need. - Use the new cross-compiler to build a cross build of X11, libz, etc... - Now you have a full environment, you can build a cross-compiled version of fltk in. > Please suggest me which cross compiler can be used for this purpose. There's no simple answer to this - it depends entirely on what board you have, what OS environment you are running, etc. What build environment does the board vendor use? > what is the procedure to be followed to croos compile FLTK under linux > environment Once you have a fully working cross-compilation environment, building fltk is straightforward. There's been some tweaking to the fltk-1.3 configure/makefiles so that they may well honour cross-compilation settings at configure time. However, fltk-1.1 and IIRC fltk-2 do not, so for those, I use this process (actually I also do this for fltk-1.3): - Make a clean checkout of fltk, on host linux machine (assuming the target is also a linux machine!) and run configure normally. - Do Not "make" the fltk build; instead, hand-edit the makeinclude file in the top level of the fltk build tree to set the compiler names, tools, include paths, library paths, etc. to explicitly reference the cross-compilation environment (not the host environment) and similarly hand-edit the auto-generated config.h file to reflect the realities of the target environment. - Now hit make. Wait. This will build the (cross-compiled)fltk libs and a cross-compiled instance of fluid. - It will then attempt to *run* this instance of fluid on the host to auto-generate some of the test programs. This will fail (you can't normally run a cross compiled arm binary on an x86 box...) So tweak the paths to make sure that the host fluid is used rather than the cross-fluid. - Build the test and example folders, and copy these binaries to your target. Test each to see what works and what does not. Hopefully everything works. - If not, go back and figure out what went wrong. - Rinse and repeat... _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
