Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot mix incompatible Qt versions #1431

Closed
eugval opened this issue Sep 23, 2019 · 13 comments
Closed

Cannot mix incompatible Qt versions #1431

eugval opened this issue Sep 23, 2019 · 13 comments

Comments

@eugval
Copy link

eugval commented Sep 23, 2019

Following the installation instructions form here , I installed rviz and run

rosrun rviz rviz

And I get the following output:
image

It seems that I need to upgrate Qt to version 5.13 from 5.95, but even after following the instructions from here:

  • Install the newest Qt Version from the Qt website
  • Update the qtchooser default.conf to point to the newly installed version of Qt,

the result is the same and when I run rviz the output is the same.

I am quite new to ROS and Rviz, any help in how to fix this would be much appreciated!

I am running the following:

  • OS Version: Ubuntu 18.04
  • ROS Distro: Melodic
  • qtchooser -l gives
    image
  • qmake --version points to the (correct) newly installed version of Qt
    image
@rhaschke
Copy link
Contributor

When you installed rviz from binary packages (via sudo apt-get install ros-melodic-rviz), this rviz version is bound to the default Qt version shipped with Ubuntu (which is 5.9.5).
If you want to use your private Qt version, you need to build rviz from source. But actually, I don't recommend this, if you didn't manage the above.

@eugval
Copy link
Author

eugval commented Sep 24, 2019

Thanks!

Any ideas why it gave me the incompatible Qt library error message then when I just installed through apt or how could I fix it?

I thought because it was expecting a later version of Qt than the Ubuntu default so I installed 5.13.1, but as you say this was not the issue?

@rhaschke
Copy link
Contributor

Probably you had another Qt version installed in your system and included via LD_LIBRARY_PATH.
On a clean Ubuntu installation, you won't observe such issues.

@eugval
Copy link
Author

eugval commented Sep 24, 2019

Fantastic! That was it, thank you.

For reference : VRep seemed to be the issue. When I cleared the LD_LIBRARY_PATH of the path to v-rep, it started working, so it probably uses its own version of Qt, and points to it via LD_LIBRARY_PATH.

@yquantao
Copy link

Fantastic! That was it, thank you.

For reference : VRep seemed to be the issue. When I cleared the LD_LIBRARY_PATH of the path to v-rep, it started working, so it probably uses its own version of Qt, and points to it via LD_LIBRARY_PATH.

I met the same problem, how did you clear the LD_LIBRARY_PATH? I commented out it in .bashrc, but it does not work.

@rhaschke
Copy link
Contributor

When you updated .bashrc, you need to create a new terminal first to get the updated environment.

@RahulraaghavA1308
Copy link

Fantastic! That was it, thank you.

For reference : VRep seemed to be the issue. When I cleared the LD_LIBRARY_PATH of the path to v-rep, it started working, so it probably uses its own version of Qt, and points to it via LD_LIBRARY_PATH.

Yeah Thank you so much. this worked for me. I commented those lines in the .bashrc file and the issue was solve

@lgzid
Copy link

lgzid commented Aug 10, 2023

@yquantao how can i use vrep and rviz together

@rhaschke
Copy link
Contributor

@lgzid, simply don't set a default LD_LIBRARY_PATH (aiming for a one-fits-all configuration, which doesn't work) but configure it depending on the application(s) to start. Sourcing ROS' setup.bash files automatically configures (actually augments) the LD_LIBRARY_PATH with all stuff required for ROS. If you have a similar script for VREP your done.

@lgzid
Copy link

lgzid commented Aug 10, 2023

@rhaschke
Thank you for your reply!
May I ask if there is a similar tutorial to modify? I am not sure about the specific operation
This is my .bashrc file:
export COPPELIASIM_ROOT=/home/***/software/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COPPELIASIM_ROOT export QT_QPA_PLATFORM_PLUGIN_PATH=$COPPELIASIM_ROOT

@rhaschke
Copy link
Contributor

You should remove the LD_LIBRARY_PATH setting from your .bashrc. Just keep:

export COPPELIASIM_ROOT=/home/***/software/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04
export QT_QPA_PLATFORM_PLUGIN_PATH=$COPPELIASIM_ROOT

Create a separate script vrep.sh comprising:
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$COPPELIASIM_ROOT" vrep

@lgzid
Copy link

lgzid commented Aug 10, 2023

@rhaschke
Thank you for your reply!
Actually, I need to use rviz, vrep, and pyrep to complete my work.

I found the problem in the third line:

export QT_QPA_PLATFORM_PLUGIN_PATH=$COPPELIASIM_ROOT

When I cleared it, rviz and vrep worked normally.But the pyrep doesn't work because it can't find the path to QT.

I just tried your approach, but it still hasn't worked.
This is my modified file:
.bashrc:

export COPPELIASIM_ROOT=/home/***/software/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04
export QT_QPA_PLATFORM_PLUGIN_PATH=$COPPELIASIM_ROOT

coppeliasim.sh:

# LD_LIBRARY_PATH=$dirname:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COPPELIASIM_ROOT
export LD_LIBRARY_PATH

@rhaschke
Copy link
Contributor

Then just set the QT_QPA_PLATFORM_PLUGIN_PATH variable just for pyrep in a similar fashion as described above.
Please stop spamming this thread, but ask the pyrep community for further help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants