PDA

View Full Version : Mac installation issue with .profile



jcr
13th July 2006, 16:42
Hello,
I am pretty new with the mac, so the question might be dumb.. but here it goes.
I have successfully installed qt 4.1.4.
I found the .profile file using the terminal in /Users/<yourUsername>/
and the .profile file now contains:


# Your previous .profile (if any) is saved as .profile.dpsaved
# Setting the path for DarwinPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
PATH=/usr/local/Trolltech/Qt-4.1.4/bin:$PATH
export PATH


when I type qmake in the terminal, I am getting:
-bash: qmake: command not found
when I go to the directory /usr/local/Trolltech/Qt-4.1.4/bin and I type qmake there same answer... I must be missing something obvious

Thanks helping me out.

jacek
13th July 2006, 17:00
I'm not a Mac user (unfortunately), but did you install precompiled Qt or just its sources?

jcr
13th July 2006, 17:05
I downloaded from qtcenter.org front page and did:
./configure
make
sudo make install

jacek
13th July 2006, 17:10
What files do you have in /usr/local/Trolltech/Qt-4.1.4/bin?

jcr
13th July 2006, 17:13
cd /usr/local/Trolltech/Qt-4.1.4/bin
ls -al
returns:
drwxr-xr-x 16 root wheel 544 Jul 10 00:58 .
drwxr-xr-x 13 root wheel 442 Jul 10 00:58 ..
drwxr-xr-x 3 root wheel 102 Jul 10 00:57 Designer.app
drwxr-xr-x 3 root wheel 102 Jul 10 00:56 Linguist.app
drwxr-xr-x 3 root wheel 102 Jul 10 00:56 assistant.app
-rwxr-xr-x 1 root wheel 130976 Jul 10 00:56 lrelease
-rwxr-xr-x 1 root wheel 189880 Jul 10 00:56 lupdate
-rwxr-xr-x 1 root wheel 723252 Jul 10 00:55 moc
-rwxr-xr-x 1 root wheel 109396 Jul 10 00:56 qm2ts
-rwxr-xr-x 1 root wheel 9909656 Jul 10 00:58 qmake
-rwxr-xr-x 1 root wheel 1144708 Jul 10 00:56 qt3to4
drwxr-xr-x 3 root wheel 102 Jul 10 00:57 qtconfig.app
drwxr-xr-x 3 root wheel 102 Jul 10 00:57 qtdemo.app
-rwxr-xr-x 1 root wheel 1081604 Jul 10 00:55 rcc
-rwxr-xr-x 1 root wheel 1565712 Jul 10 00:55 uic
-rwxr-xr-x 1 root wheel 891296 Jul 10 00:56 uic3

thanks for your help!

jacek
13th July 2006, 17:21
-rwxr-xr-x 1 root wheel 9909656 Jul 10 00:58 qmake
What happens when you run:
cd /usr/local/Trolltech/Qt-4.1.4/bin
./qmake -help?

jcr
13th July 2006, 17:31
qmake -help returns
-bash: qmake: command not found
but
./qmake -help returns
Usage: ./qmake [mode] [options] [files]
QMake has two modes, one mode for generating project files based on
some heuristics, ...

the './' is pretty useful

Now, I have this folder with a finance.pro file and
qmake finance.pro from that folder returns
-bash: qmake: command not found
but
./qmake /ventures/finance/finance.pro from the qt bin folder
works fine (actually it fails but for good reason since I have to make a few changes to the .pro file)

So the problem is probably with the .profile file...
Thanks!

jacek
13th July 2006, 17:38
So the problem is probably with the .profile file...
AFAIR .profile is read when bash starts, so you will have to either open another terminal or re-login to see the changes.

jcr
13th July 2006, 17:52
I restarted bash Terminal, logget out and no improvement
I rewrote the .profile as
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/Trolltech/Qt-4.1.4/bin:$P$
I logged out
but no luck yet

jacek
13th July 2006, 18:13
I rewrote the .profile as
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/Trolltech/Qt-4.1.4/bin:$P$
I logged out but no luck yet
What happens when you run:
echo $PATH
and
export PATH="/usr/local/Trolltech/Qt-4.1.4/bin:$PATH"
qmake -help?

jcr
13th July 2006, 18:28
Jacek
Thanks you very much.

echo $PATH returns
/opt/local/bin:/opt/local/sbin:/usr/local/Trolltech/Qt-4.1.4/bin:$
and
qmake -path
works!!!

(by the way, I must have done something wrong because command like ls or nano do not work any more)... It is getting messy.

jacek
13th July 2006, 18:59
echo $PATH returns
/opt/local/bin:/opt/local/sbin:/usr/local/Trolltech/Qt-4.1.4/bin:$
There shouldn't be "$" at the end. Check your .profile file again.


I must have done something wrong because command like ls or nano do not work any more
You can always use absolute paths, like "/bin/ls".

patrik08
14th July 2006, 00:17
If you use prefix /usr/local/Trolltech/Qt-4.1.4/bin

Yo dont see the bin QT on Mac finder .....

./configure -prefix /Developer/qt -qt-zlib -qt-libpng -qt-libjpeg -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk -static && make sub-src

remove -static if you dont have 55GB free!

and xcode & qt is on parent dir to enable Finder.... to see /Developer/

cat .profile


#
# Your previous .profile (if any) is saved as .profile.dpsaved
# Setting the path for DarwinPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
PATH=/Developer/qt/bin:$PATH
QTDIR=/Developer/qt
QMAKESPEC=macx-g++
export PATH
export QMAKESPEC
export QTDIR

/opt/ from http://darwinports.opendarwin.org/ libs mysql ......

patrik08
14th July 2006, 01:14
I have write a small howto .. install on mac....

http://wiki.qtcentre.org/index.php?title=Qt4_install_MAC

PS: thanks to People which correct the grammar.

jcr
14th July 2006, 03:37
I guess I am going to have to reinstall Qt 4.1.4 on my system. At this point, I have a couple of questions:

1. To uninstall Qt, is it enough to delete the folder Qt-4.1.4? Is a better way to do that? Under Windows there is a utility "uninstall Qt..." but I have not found it on Mac...

2. 55 GB for static, that's a lot. Is the static option essential for a Mac application?

Thanks to patrik08 for the note.

patrik08
14th July 2006, 09:05
I guess I am going to have to reinstall Qt 4.1.4 on my system. At this point, I have a couple of questions:

1. To uninstall Qt, is it enough to delete the folder Qt-4.1.4? Is a better way to do that? Under Windows there is a utility "uninstall Qt..." but I have not found it on Mac...

2. 55 GB for static, that's a lot. Is the static option essential for a Mac application?
.

2 - no the static method is only to share application to other wo not have QDIR envoirment...
the are other way to put library inside ***app dir http://doc.trolltech.com/4.1/deployment-mac.html


You can check what other libraries your application links to using the otool:
# otool -L plugandpaint.app/Contents/MacOs/plugandpaint

1- yes QT take only one dir
# rm -rf /location/dir is enough ...


IMO: 1- i test next week-end a build -static whitout demo & example universal ppc & intel to become GB of qt4 buildet.... & i update the wiki if i found a smaller way....
2 - I hope one amministrator from this forum Axeljager (mac experience) write other way to install on mac & insert libraries to app /Contents/ ....

jcr
14th July 2006, 18:19
I completely reinstalled qt4
I downloaded from qtcenter the mac file, created the folder/Developer/qt, unpacked there the downloaded stuff
in the terminal, I moved to the /developer/qt folder and typed:
./configure -prefix /Developer/qt -qt-zlib -qt-libpng -qt-libjpeg -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk
After a while, I am getting the following message:
"
Qt is now configured for building. Just run 'make'.
Once everything is built, Qt is installed.
You should not run 'make install'.
To reconfigure, run 'make confclean' and 'configure'.
"
I ran make and it compiled fine. My ~/.profile is like this:
"
#
# Your previous .profile (if any) is saved as .profile.dpsaved
# Setting the path for DarwinPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
PATH=/Developer/qt/bin:$PATH
QTDIR=/Developer/qt
QMAKESPEC=macx-g++
export PATH
export QMAKESPEC
export QTDIR
"
I can compile programs without any issue (Qt's claim that the same code works both under windows and mac is so true!).
The only problem is that I must explicitly type the full path to qmake:
/developer/qt/bin/qmake finance.pro works while qmake finance.pro returns
"
-bash: qmake: command not found
"

If I may add two pieces of advice to mac newbies trying to install qt:
1. To learn the basics of bash unix:
http://osxfaq.com/Tutorials/LearningCenter/index.ws
2. To install boost the best way is to go to darwinports.com and follow the instructions. Easier than through the boost website.

rickbsgu
6th October 2006, 17:47
I'm having pathing problems on Mac, as well.

For instance, under my home directory, I have a 'bin' directory. (using tcsh) in my .cshrc file I set the path


setenv PATH $PATH:~/bin

if I "echo $PATH", it looks right. But, if I try to run something in there, it doesn't find it.

Curious. This works under other xNIXes (and Cygwin, for that matter) just fine.

I got around it temporarily by setting a command alias, but I'd like to figure out how to set the path properly.

rickb

rickbsgu
7th October 2006, 07:34
Ok, cancel above. Include problems - got it fixed.

However, '~' doesn't seem to be getting expanded in the .cshrc included file, for whatever reason. Maybe I already knew that at one time...

Anyway, $HOME works just fine.

Onward,
rickb