Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On my Gentoo systems I've never had a problem with this and I run moc as I run any other command in the terminal. I recently switch to Fedora 15/16 and notice that running moc doesn't work. I get bash: moc: command not found.... Instead, I have to give its full path, /usr/lib64/qt4/bin/moc.

  1. I would like to know why the Fedora folks have not set this up so calling moc just works without giving its full path (or, perhaps I've done something to break?)

  2. As I'm very new to non-Gentoo systems, I would like to know of a universal way to call moc so that it works on any *nix system.

share|improve this question
    
It could be helpful to know, than media-sound/moc package is running by mocp command. –  ДМИТРИЙ МАЛИКОВ Nov 19 '11 at 11:01
add comment

2 Answers

To be able to run application without specifying whole path to it, directory where executable is installed must be in $PATH variable. You can check what is in $PATH by using echo $PATH. To modify $PATH you can use export PATH=$PATH:/usr/lib64/qt4/bin/. After that you can use just moc to start it. To make changes permanent you may put that line to your ~/.bashrc file.

share|improve this answer
    
I know all that! I'm trying to write scripts that will work on any *nix system, and my scripts call moc. If running moc doesn't work eventhough it's installed, how would I make sure my scripts work? –  Arlen Nov 19 '11 at 18:13
add comment

1) I would like to know why the Fedora folks have not set this up so calling moc just works without giving its full path (or, perhaps I've done something to break?)

This should be for backward compatibility with Qt3.

2) As I'm very new to non-Gentoo systems, I would like to know of a universal way to call moc so that it works on any *nix system.

You may use pkg-config :

pkg-config --variable=moc_location QtCore 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.