Qt Mobility Library Question on OS X
-
I am still struggling through trying to get mobility to work on OS X. I noticed that the documentation wants this command in your .profile file:
@ LD_LIBRARY_PATH=$TARGET_DIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH@I understand the target directory, but what is the $LD_LIBRARY_PATH and how can I find it?
-
LD_LIBRARY_PATH is environment variable with paths of directories with libraries. It is usally empty and you can safely set it without concatenation, but sometime you have to set it repeatedly with two different paths and want them to be together in this list, in this case you should append old value of variable to the end of new value.
-
How can I know for sure what mine is?
-
If you are not sure about your LD_LIBRARY_PATH you can view it by using echo
@
echo $LD_LIBRARY_PATH
@
or simply use full variable setting
@
LD_LIBRARY_PATH=/some/path/here/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
@ -
If it would ever be possible to create an installer for Qt Mobility, it would be great.
-
Interesting. I will try that. Shouldn't this be automated?
-
It seems like with all of these problems that people are having with Mobility that some sort of installer would really be helpful.
-
Using that kind of concatenation of LD_LIBRARY_PATH is dangerous (at least in Linux). You really should make sure the LD_LIBRARY_PATH does not contain empty path elements ever.
This is due to the loader evaluating LD_LIBRARY_PATH to find libraries an executable depends on. For some reason a empty path element (the thing between the ':' or ':' and the end of the string) is considered to be the current directory. So if you have LD_LIBRARY_PATH set to "/some/path::/some/other/path" then the loader will check the current directory for libraries. This is a security issue as anybody can make you run code for them if they can get you to start any executable while in a directory where they can put a library.
As I said before: This is the case in Linux. I am not sure the MacOS loader behaves in the same way... So check before following this potentially dangerous advice.
-
Again I would emphasize the great need for some sort of installer to minimize these risks. Perhaps adding it and all its dependencies to aptitude?
-
There is no aptitude in a standard Mac OS X installation.
On a Debian or Ubunut box there might be already a package repository (known as PPA: Personal Package Archive), that can be added to apt/sources.list. I'm pretty sure they will be in the official repositories sometime the packages are sort-of stable.
-
Do you have any sort of general timeline idea of when that will happen?
-
Can I add:
@if [ "x$DYLD_LIBRARY_PATH" = "x" ]; then
export DYLD_LIBRARY_PATH="/path/to/my/lib"
else
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/path/to/my/lib"
fi@directly to my .profile file and only change the two file paths?
-
Great to know, I will try it. Thanks.