当前位置:网站首页>Edit the project steps to run QT and opencv in the clion

Edit the project steps to run QT and opencv in the clion

2022-06-11 19:48:00 Sanfeng grocery store

Must look at other people's information

1

3
4- clion Official qt course

Set the compiler to msvc Or is it mingw

The compiler should correspond to the library ,qt Kuhe opencv Library and the whole project toolchain All should be the same . So if it's all msvc, that cmake in ,qt You may need to choose msvc The path of (qt Automatically generated by default cmake It may not be necessary ),opencv It's also msvc The path of .
clion Of toolcchain To correspond ,msvc yes default.nmake.exe, cl.exe

 Insert picture description here

Process finished with exit code -1073741515 (0xC0000135) Do you have any questions 139

The background of this problem is build normal , But the runtime will report this error . This is because clion Can't find qt Of dll Dynamic library .
Same question
Add environment variables and method 2 to method 1 in this post , Copy dll Can solve problems .( The essential reason is that the dynamic library needs to be found by the code , So you need to add it to the environment variable . Or put it in the running directory of the program )
Be careful : To match the code selected toolchain Corresponding , The choice is msvc The added directory is {QtVersion}\msvc2017_64\bin

If you cannot double-click to open ui file

External commands are a method .

Used and wanted to use xml Mode on , Just press and drag to the editing area .
Open this with an external command ui File can , A few more steps .
external tools
 Insert picture description here
If you still want to double-click ui file , let qt Turn on automatically , What shall I do? ?
 Insert picture description here
To get rid of clion Associations to files . So this file is a ? Unknown file for , then clion Will be based on ui suffix , Go to the system to find the default application that can open her . That is to say qtcreator.
 Insert picture description here

The specific operation is :
 Insert picture description here
After deleting , Right click on this ui file , choice Associate with File Type...
Then choose :Open matching files in associated application option
In the post ,vladislav This method is mentioned

原网站

版权声明
本文为[Sanfeng grocery store]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011816550603.html