Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / gtk demo program execution problems

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. gtk demo program execution problems
#3235
Posted by: 2004-01-14 21:57:25
Hi Folks,

I've installed wxwindows and built all the demos.  And they run fine.  I've also built my application and it runs fine.  The problem?  Both the demos and my application only run fine when they stay right in the directory they were built in.  If I move a demo app like "dialogs" or my own app to any other directory, I get a:

"error while loading shared libraries ../../wcGtk-2.4.0//lib/libwx_gtk2.4.so.0.0.0 : cannot open shared objrect file: no such file or directory"

So its trying to find that so exactly in the same place that library is built.  How can I get around that? How do people distribute their programs if the .so's library path is hard coded into the executable somehow?  Is there a way to statically link the lib into the exe?  Is there a way to tell the exe that the .so will always be in the same directory as itself and then always distribute the .so and the .exe together?  I'm more of a windows programmer and the windows version of my program works fine, I know my issue is probably in the unix make file I have. Which I pretty much ripped off verbatic from the demo makefiles:

top_srcdir = ../../wxWindows-gtk/
top_builddir = ../../wxWindows-gtk/
program_dir = cs_console/console_window

PROGRAM=cs_console

OBJECTS =consoleapp.o
logeditctrl.o
logframe.o
optiondlg.o 
secondsock.o



include ../../wxWindows-gtk/src/makeprog.env

# -include $(DEPFILES)
Message2. Re: gtk demo program execution problems
#3237
Posted by: upCASE 2004-01-14 22:45:09
Hi!
Well, it's been a while since I last booted Linux (I really should to keep updated), but may I ask if you ran "make install" after compiling the lib?

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: gtk demo program execution problems
#3239
Posted by: 2004-01-14 22:57:35
Thanks for the response.

Yup, I did do the make install.  I did it again just to be sure.  Some things to note

1) The error message that pops up, says it's definitely reaching out to grab the .so in the place where I built the library. But since it's using a relative path to look for it, its not finding it if its in any other directory than the one I built the app in. 

ie "../../wcGtk-2.4.0//lib/libwx_gtk2.4.so.0.0.0"

I'll keep poking around. Thanks alot!
Message4. addendum
#3240
Posted by: 2004-01-14 23:00:57
And sure enough, libwx_gtk-2.4.so.0.0.0 is in usr/local/lib.  But again its looking specifically in my wxwindows build directory for it.
Message5. Re: gtk demo program execution problems
#3242
Posted by: upCASE 2004-01-15 02:09:26
Hi!
http://linux4u.jinr.ru/usoft/WWW/www_debian.org/Documentation/elf/node16.html
Maybe this will help. Not sure but I think I used ldconfig... Man, I really have to skip to Linux from time to time unless I want to forget more than I can learn :)

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0