Re: [UFO-devel] Hallo Wieder - Clarification of my problem - I will pay $ for your consulting!
Status: Beta
Brought to you by:
schmidtjf
From: Andrew H. <hv...@st...> - 2007-05-20 17:18:21
|
> Hi Andrew, > > On Sunday 20 May 2007, Andrew Hvatum wrote: > >> Gruss Johannes, >> >> Thanks for all the help! The program is working really well. It's still >> a way from completion, but I'll send >> you the source and a copy when it's finished. >> >> I'd like to statically link the final executable with libUFO, sorry if >> this is a dumb question, but how do I >> get it to produce a libUFO.a file that I can link with? If this is hard >> to do, how else could I go about >> setting up the program so it runs on platforms where people don't have >> libUFO installed? >> > > You could still deliver the dynamic library and add the directory to the > dll/so search path, e.g. setting the LD_LIBRARY_PATH environment variable > under unix like systems. > > To create static libraries, run configure with > ./configure --enable-static > > (see also ./configure --help) > > > Regards, > Johannes > Thanks! That worked, now it compiles and gives me a libufo.a file. When I try to run make on my program to statically link it I get a series of errors. Maybe you could take a quick look and tell me if it's a problem with my system/code? Or maybe libufo isn't really designed to be statically linked so that's what's making it unhappy. All the errors seem to be restricted to usharedlib.cpp (not needed when using static libs, I think) and uxglxdriver, so I'm going to go and try commenting both of those files out before statically compiling libufo and see what happens. Mit freundlichen Grüssen! Andrew [hvatum@cs18 MakeMosaic]$ make g++ MakeMosaic.cpp libufo.a -o MosaicMaximus.exe usharedlib.o: In function `ufo::USharedLib::unload()': /learning/libUFO/ufo-0.8.4/src/usharedlib.cpp:219: undefined reference to `dlclose' usharedlib.o: In function `ufo::USharedLib::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ufo::USharedLib::ldmode_t)': /learning/libUFO/ufo-0.8.4/src/usharedlib.cpp:138: undefined reference to `dlopen' usharedlib.o: In function `ufo::USharedLib::symbol(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': /learning/libUFO/ufo-0.8.4/src/usharedlib.cpp:80: undefined reference to `dlsym' /learning/libUFO/ufo-0.8.4/src/usharedlib.cpp:82: undefined reference to `dlerror' uxglxdriver.o: In function `ufo::UXGLXDevice::setDecorations()': ux/uxglxdriver.cpp:1078: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1082: undefined reference to `XChangeProperty' uxglxdriver.o: In function `ufo::UXGLXDevice::setWMHints()': ux/uxglxdriver.cpp:1119: undefined reference to `XAllocWMHints' ux/uxglxdriver.cpp:1128: undefined reference to `XSetWMHints' ux/uxglxdriver.cpp:1130: undefined reference to `XFree' ux/uxglxdriver.cpp:1173: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1173: undefined reference to `XChangeProperty' ux/uxglxdriver.cpp:1185: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1185: undefined reference to `XChangeProperty' ux/uxglxdriver.cpp:1189: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1189: undefined reference to `XDeleteProperty' ux/uxglxdriver.cpp:1139: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1141: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1150: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1154: undefined reference to `XInternAtom' ux/uxglxdriver.cpp:1158: undefined reference to `XInternAtom' uxglxdriver.o:ux/uxglxdriver.cpp:1162: more undefined references to `XInternAtom' follow uxglxdriver.o: In function `ufo::UXGLXDevice::setWMHints()': ux/uxglxdriver.cpp:1177: undefined reference to `XDeleteProperty' uxglxdriver.o: In function `ufo::UXGLXDevice::setSizeHints()': ux/uxglxdriver.cpp:1089: undefined reference to `XAllocSizeHints' ux/uxglxdriver.cpp:1111: undefined reference to `XSetWMNormalHints' uxglxdriver.o: In function `ufo::UXGLXDevice::hide()': ux/uxglxdriver.cpp:973: undefined reference to `XDestroyWindow' ux/uxglxdriver.cpp:977: undefined reference to `XFlush' uxglxdriver.o: In function `ufo::UXGLXDevice::show()': ux/uxglxdriver.cpp:904: undefined reference to `XCreateColormap' ux/uxglxdriver.cpp:918: undefined reference to `XCreateWindow' ux/uxglxdriver.cpp:948: undefined reference to `XSetWMProtocols' ux/uxglxdriver.cpp:951: undefined reference to `XMapWindow' uxglxdriver.o: In function `ufo::UXGLXDevice::setTitle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': ux/uxglxdriver.cpp:843: undefined reference to `XStringListToTextProperty' ux/uxglxdriver.cpp:845: undefined reference to `XSetWMName' ux/uxglxdriver.cpp:846: undefined reference to `XSetWMIconName' uxglxdriver.o: In function `ufo::UXGLXDevice::setLocation(int, int)': ux/uxglxdriver.cpp:825: undefined reference to `XMoveWindow' uxglxdriver.o: In function `ufo::UXGLXDevice::setSize(int, int)': ux/uxglxdriver.cpp:805: undefined reference to `XSetWMNormalHints' ux/uxglxdriver.cpp:806: undefined reference to `XResizeWindow' uxglxdriver.o: In function `ufo::UXGLXDriver::mapX11Unicode(XKeyEvent const&)': ux/uxglxdriver.cpp:446: undefined reference to `XLookupString' uxglxdriver.o: In function `ufo::UXGLXDriver::mapX11Keycode(XKeyEvent const&)': ux/uxglxdriver.cpp:360: undefined reference to `XKeycodeToKeysym' uxglxdriver.o: In function `ufo::UXGLXDriver::quit()': ux/uxglxdriver.cpp:139: undefined reference to `XSync' ux/uxglxdriver.cpp:146: undefined reference to `XCloseDisplay' uxglxdriver.o: In function `ufo::UXGLXDriver::init()': ux/uxglxdriver.cpp:77: undefined reference to `XDisplayName' ux/uxglxdriver.cpp:77: undefined reference to `XOpenDisplay' ux/uxglxdriver.cpp:110: undefined reference to `XDisplayName' ux/uxglxdriver.cpp:121: undefined reference to `XInternAtom' uxglxdriver.o: In function `ufo::UXGLXDriver::pumpEvents()': ux/uxglxdriver.cpp:162: undefined reference to `XFlush' ux/uxglxdriver.cpp:165: undefined reference to `XNextEvent' ux/uxglxdriver.cpp:164: undefined reference to `XPending' uxglxdriver.o: In function `ufo::UXGLXDevice::setSizeHints()': ux/uxglxdriver.cpp:1112: undefined reference to `XFree' uxglxdriver.o: In function `UGLXVideoPlugin::isAvailable()': ux/uxglxdriver.cpp:716: undefined reference to `XOpenDisplay' ux/uxglxdriver.cpp:718: undefined reference to `XCloseDisplay' libufo.a(uxsdldriver.o): In function `ufo::UXSDLDevice::setLocation(int, int)': ux/uxsdldriver.cpp:509: undefined reference to `XMoveWindow' collect2: ld returned 1 exit status make: *** [all] Error 1 [hvatum@cs18 MakeMosaic]$ > > >>> Hi again, >>> >>> Just to make clear that the image is correctly displayed: >>> I have attached the openclipart.org logo (which is public domain) as C >>> header file (char array), again named "fuzzy.h". >>> >>> The previous one was just random painting with the GIMP and looked like >>> some screwed up memory ... >>> >>> >>> I hope I have the time on weekend to describe the UFO architecture >>> a little bit. >>> >>> >>> Regards, >>> Johannes >>> >>> Am Freitag, 11. Mai 2007 14:28 schrieb Johannes Schmidt: >>> >>>> Hi Andrew, >>>> >>>> I have to admit, that it isn't really outlined in detail, >>>> how to use images in LibUFO. >>>> >>>> If you want to pipe an array of chars representing an image, you can use >>>> UImageIO to create the basic image software buffer used in UFO. >>>> >>>> To get a hardware image (i.e. OpenGL image) usable in UFO, >>>> you need a UImage object. >>>> Usually, you shouldn't need to use the UGL_Image class directly. >>>> >>>> In short: >>>> Use the display image to convert the UImageIO object (the software >>>> buffer) to a UImage object (the hardware surface). >>>> UImage * UDisplay::createImage(UImageIO *); >>>> >>>> Longer version: >>>> Several backends handle hardware data differently (especially, how >>>> hardware surfaces are shared between contexts) >>>> >>>> The display object handles the whole connection to the underlying system >>>> and controls all data acquired by the system (for instance an OpenGL >>>> texture encapsulated in a UImage object). >>>> >>>> Therefore, the display object is responsible for all data/memory >>>> allocated by the system, as video devices, images, fonts, events etc. >>>> (this has changed a little bit over time, so this is usually done by the >>>> UXDisplay class, whereas the UDisplay class is still a bit limited). >>>> >>>> I have attached two files: >>>> A modified version of test/base.cpp, which reads in a char array, >>>> creates a UImageIO object, then a UImage object and uses this as Icon >>>> for a label. >>>> >>>> A header file called fuzzy.h which contains the image array (created >>>> with the GIMP). >>>> >>>> Compile it via: >>>> g++ -o base base.cpp `pkg-config --cflags --libs ufo` >>>> >>>> If you have the GIMP, you can create another image and save it as C >>>> header under the name "fuzzy.h", then recompile. >>>> >>>> If there are any problems understanding the code, please ask. >>>> >>>> >>>> Best regards, >>>> Johannes >>>> >>>> Am Freitag, 11. Mai 2007 03:43 schrieb hv...@st...: >>>> >>>>> Hi again, >>>>> >>>>> I'm having some serious trouble trying to figure out how to pass an >>>>> image so that libUFO displays it. I'm trying to follow the directions >>>>> which you outlined on this email that I found archived on the mailing >>>>> list, but I can't for the life of me get it to work. >>>>> >>>>> I'm really panicking, because I need to have this functionality working >>>>> soon. As far as I can tell from the specifications on sourceforge, >>>>> UGL_Image must be passed as an argument to UImage, and then you can >>>>> pass UImageIO as an argument to UGL_Image? (And UGL_Image can take a >>>>> flat array of unsigned char, each representing one color of a pixel). >>>>> >>>>> If you could write out a quick example which reads in an image from an >>>>> array or something (not a file, I can do that with UIcon) and explain a >>>>> bit how it functions I'd be happy to Paypal you $25 for all the time >>>>> you've spent helping me. Consider it a "donation" for all the hard work >>>>> you've put into this great toolkit! >>>>> >>>>> Mit sehr Freundlichen Grussen, >>>>> Andrew >>>>> >>>>> "It is not that trivial but it is possible. >>>>> >>>>> If you do not care about performance too much (at least in the >>>>> beginning), you can use the built-in image class (UImage) and assign >>>>> this as icon of a label (or button). >>>>> >>>>> That means, you create your own image buffer and feed it as RGB(A) data >>>>> to an UImageIO class, create an image and so on. I have attached a >>>>> small example (image.cpp) which shows how to do that (based on the >>>>> base.cpp example). Compile it via: >>>>> g++ -o image image.cpp `pkg-config --cflags --libs ufo` >>>>> >>>>> Otherwise you can draw the image yourself using OpenGL methods. To do >>>>> this, you have to subclass UWidget and override >>>>> UWidget::paintWidget(UGraphics*) with your own code (set up matrices >>>>> and OpenGL state, draw image, revert OpenGL matrices and states). " >>>>> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > LibUFO-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libufo-devel > |