Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the qmake path in to [Qt-dir/bin/].

Tags:

qmake

I am trying to compile a Qt application through command line in ubuntu. for me "which qmake " giving /usr/bin. I have given the Qt/bin path in PATH variable. How to change the qmake path in to Qt/bin.

Thanks in advance.

like image 214
Resmi Avatar asked Dec 02 '25 13:12

Resmi


1 Answers

Your question is difficult to understand, so I'll summarize what I think you've asked:

There is a qmake installed into /usr/bin/qmake and a different qmake installed in /path/to/Qt/bin/qmake. You want to use the /path/to/Qt/bin/qmake. You have added /path/to/Qt/bin to your PATH environment variable but calling which qmake still returns /usr/bin/qmake.

There's several possible causes:

  • The permissions on /path/to/Qt/bin/qmake may not allow you to execute it. Check that ls -l /path/to/Qt/bin/qmake shows that you have x permission.
  • The permissions on any directory above /path/to/Qt/bin/qmake may not allow you to traverse the directory. If the ls -l output from the previous step worked, this is not your problem.
  • Make sure /path/to/Qt/bin is one of the first entries in your PATH environment variable. The shell searches directories from the first to the last, in order, to find executables.
  • If you added the directory to your PATH after running qmake, the shell will have hashed the location of the qmake executable internally as a performance optimization. Executables almost never move during a shell session, so this is a useful way to reduce useless system calls. Check the output of hash -t qmake to see if this is what happened. Or just execute hash -r to force the shell to forget all paths. (This has no serious consequences.)
like image 123
sarnold Avatar answered Dec 04 '25 11:12

sarnold