Clion installing glfw_Using clion to configure Vulkan development environment on MacOS

When learning graphics programming, in fact, in MacOS programming environment is the default Xcode, Windows and often use Visual Studio. But since I often have to switch programming between Windows and MacOS, occasionally switch to Ubuntu, and don’t want to switch between different IDEs repeatedly, I chose CLion. The nice thing about CLion is that it’s cross-platform.
Today, I spent several hours configuring the development environment of CLion +Vulkan on MacOS, which paved the way for learning Vulkan later. Those who know CLion know that C/C++ programming of CLion uses CMAKE to do engineering construction, which can force me to use a cross-platform architecture scheme, so that I can know the underlying engineering construction like the palm of my hand, and can also promote me to further understand and learn CMAKE.
My work environment
MacOS: Big Sur

gcc version

~/C/V/shaders ❯❯❯ gcc --versionConfigured with: --prefix=/Applications/ --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1Apple clang version 12.0.0 (clang-1200.0.32.27)Target: x86_64-apple-darwin20.2.0Thread model: posixInstalledDir: /Applications/

Configure the Lib required by Vulkan
Vulkan MacOS configuration mainly refers to the Vulkan Tutorial Development Environment. However, many MacOS articles only provide Xcode configuration, but the dependency on the file package is the same. Three main things are needed: Vulkan SDK, GLFW, and GLM.
Let’s take a look at how to install each of these.
Vulkan SDK installation
Vulkan SDK can be downloaded from directly. See Getting Started with the MacOS Vulkan SDK for details on the installation process. In the process of specific installation, I adopted the step of Install the SDK-alternate method using system paths. Run the Python installation script that comes with the SDK to install:

sudo ./

The script is to install the Vulkan SDK libraries and header files in /usr/local.
/usr/local/lib is one of the directories that linker searches for required libraries. The lib installed by the user is stored in the /usr/local folder. The CLion search library is based mainly on the directories specified by the include_directories defined by Cmake.

Copying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkan/SPIRV-ToolsCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/include/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/share/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /Applications/vkconfig.appCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /Applications/vkcubepp.appCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/include/spirv_crossCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkan/SPIRV-Tools-linkCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkan/SPIRV-Tools-optCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /Applications/vkcube.appCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /Applications/vulkaninfo.appCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/include/shadercCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/include/spirv-toolsCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkan/SPIRV-Tools-reduceCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/include/glslangCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/binCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos- to /usr/local/libCopying /Volumes/vulkansdk-macos- to /usr/local/lib

Install GLFW
GLFW is used to create Windows, which supports different operating systems. Both OpenGL and Vulkan are only responsible for rendering graphics to the desktop in memory for display on the screen. As for the final creation of the desktop for each operating system, GL and Vulkan are not responsible for it. That’s what GLFW does. On Apple, GLFW can be installed through BREW. My Mac already had BREW installed, so I simply installed GLFW directly through BREW.

brew install glfw

Install the GLM
Vulkan also does not contain a mathematical library for linear algebra. So we’re going to have to use GLM when we change the graph. He can also install it through BREW.

brew install glm

After installing all the required libs above, we can set our own environment variables in a shell profile. These set environment variables will be used to indicate the path to which libraries to search when I use the CMAKE configuration file in the CLion IDE. Since I’m using ZSH, I added the GLFW and GLM lib paths to ~/.zprofile.

export GLFW_HOME="/usr/local/Cellar/glfw/3.3.2"export GLM_HOME="/usr/local/include/glm"

Note: BREW will place all installations in a directory called CELLAR, and then create soft links in /usr/local to connect to these directories under CELLAR.
And then we’re going to reroute my.zprofile.
When everything is configured, you can call the VKSDK command vkvia</code bbb> check if Vulkan was successfully installed.
You can also run the Vulkan SDK's Cube app to check it out.

Create the CLion project
Let's create a Vulkandemo project. Once created, the project is very simple, with a single HelloWorld code for main.cpp.
Let's draw a triangle here, so let's configure cmake file to make sure that all the header files and libraries we need are loaded correctly.

cmake_minimum_required(VERSION 3.17)project(VulkanDemo)set(CMAKE_CXX_STANDARD 17)# Check environment variables if (NOT DEFINED ENV{GLFW_HOME})    message(FATAL_ERROR "found no env named GLFW_HOME")endif()if (NOT DEFINED ENV{GLM_HOME})    message(FATAL_ERROR "found no env named GLM_HOME")endif()# 暂存环境变量set(GLFW_HOME $ENV{GLFW_HOME})set(GLM_HOME $ENV{GLM_HOME})add_executable(VulkanDemo main.cpp)# 添加 GLFW3 预编译库add_library(glfw SHARED IMPORTED)SET_TARGET_PROPERTIES(glfw PROPERTIES IMPORTED_LOCATION "${GLFW_HOME}/lib/libglfw.3.dylib")# GLMinclude_directories(${GLM_INCLUDE_DIRS})# Vulkanfind_package(Vulkan REQUIRED FATAL_ERROR)target_link_libraries(${PROJECT_NAME} glfw Vulkan::Vulkan)#include_directories(${Vulkan_INCLUDE_DIRS})#target_include_directories(${PROJECT_NAME} PUBLIC ${Vulkan_INCLUDE_DIRS})# copy the shader files to the cmake-build-debug folderfile(COPY shaders DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

Once cmake is configured we start drawing our triangle. This article uses the Vulkan Tutorial code directly. Copy the code to main.cpp</code bbb> We're going to use two shaders here because we're drawing triangles. The code for shader comes from this section. So we need to add two shader files and a compile script to help us generate the spir-v files.
file(COPY shaders DESTINATION ${CMAKE_CURRENT_BINARY_DIR})</code bbb>because calling openfile in main needs to open our shader file. When Clion runs the binaries of the project, it assumes that the resource files are in the cmake-build-debug</code bbb>lder. So we must copy the shader folder to cmake-build-debug</code bbb>
Take a look at what your project as a whole looks like:

Okay, finally, let's run our Vulkandemo program in CLion. A triangle was born!

How to Fix Error when integrating spring cloud openfeign with spring cloud Alibaba

When learning how to integrate spring cloud with Alibaba, we encountered an openfeign call error

Caused by: java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?
	at ~[spring-cloud-openfeign-core-3.0.0.jar:3.0.0]
	at ~[spring-cloud-openfeign-core-3.0.0.jar:3.0.0]
	at ~[spring-cloud-openfeign-core-3.0.0.jar:3.0.0]
	at ~[spring-beans-5.3.3.jar:5.3.3]
	... 47 common frames omitted

Baidu found that openfeign 3.0.0 built in spring cloud 2020.0.0 conflicts with Nacos framework of spring cloud Alibaba.

Here are two solutions

Methond 1

First add the loadbalancer dependency in pom.xml


Because nacos dependencies containing ribbon dependencies will cause loadbalancer to be invalid, you need to exclude the ribbon dependencies from nacos dependencies.


Method 2

 <!-- spring cloud 2020.0.0built-in openfeign3.0.0 and spring cloud alibaba framework nacos, seata conflict temporary solution - >

[How to Fix]Mybatisplus ignores mapped fields

In the development, we may encounter that mybatisplus uses entity class attribute for SQL operation. The entity has this attribute, but the database table does not have this field (that is, entity class attribute is not a database table field). If you don’t handle it, you will report an error.


@TableName: Database Table Related

@TableId: table primary key identifier

@TableField: table field identifier

@TableLogic: Table field logical processing annotation (logical deletion


@TableField(exists = false): indicates that the property is not a database table field, but is required to be used.
@TableField(exists = true): indicates that the property is a database table field.

After adding this annotation to the attributes of the entity class, this field will not map to the database.

   @TableField(exist = false)
    private String deptName;

How to Check Password Modification Complexity

Password modification complexity check

The corresponding password policy modules of Linux are: PAM_ Passwdqc and PAM_ pwquality . PAM_The passwdqc module corresponds to /etc/login.defs ,pam_ Pwquality corresponds to /etc/security/pwquality.conf

Module adding method: etc/pam.d/passwd

vi /etc/pam.d/passwd
password required retry=3


echo "password required retry=3" >> /etc/pam.d/passwd

Open the password complexity verification configuration file / etc / security/ pwquality.conf

vi /etc/security/pwquality.conf
retry=3Defines the number of retries that can be made if the login/change password fails.
Difok=0#defines that there must be several characters in the new password to be different from the old one. but if more than 1/2 of the characters in the new password are different from the old one, that new password will be accepted.
minlen=0#defines the minimum length of the user's password.
dcredit=0#defines how many digits must be included in the user's password.
ucredit=0#defines how many uppercase letters must be included in the user's password.
lcredit=0#defines how many lowercase letters must be included in the user's password.
ocredit=0# defines how many special characters (other than numbers and letters) must be included in the user's password.
# where =-1 means that at least one

Modify password validity file/etc/login.defs

PASS_MAX_DAYS   99999     #The maximum validity of the password, 99999: permanent period
PASS_MIN_DAYS 0 # whether the password can be changed, 0 can be changed, non-0 how many days after the password can be changed
PASS_MIN_LEN 5 #Minimum length of password, use pam_cracklib module, this parameter is no longer valid
PASS_WARN_AGE 7 # how many days before the password expires to notify the user to change the password when they log in

Python Selenium: element is not attached to the page document error

Recently, when I was working on an automatic office project in selenium, I encountered an error in the mouse event Click(), when I was looking for page elements

div = driver.find_elements_by_xpath('//*[@id="test"]') #Find certain elements of a page
for x in range(10):#click on the first 10 links in order
	driver.switch_to.window(driver.window_handles[2])#switch to the page handle of the clicked page to perform the operation
	#Omit the operation code here
	driver.close()#close the current tab
	driver.switch_to.window(driver.window_handles[1])#switch to the initial tab handle

When the above code is executed, you can click the first link. When you loop to the second link, you will get the error of element is not attached to the page document.
After careful observation, it is found that when the first link is closed, the initial page will be forced to refresh once. Therefore, it is very likely that the element in the div has changed, resulting in that the element cannot be found later. Therefore, I try to put the statement of finding the element in the loop, that is, each loop will look up the element again, and the problem is solved. After the solution, the code comparison is as follows:

for x in range(10):#Click on the first 10 links in order
	div = driver.find_elements_by_xpath('//*[@id="test"]') # Move the find element statement inside the loop
	driver.switch_to.window(driver.window_handles[2])#Switch to the page handle of the clicked page to perform the operation
	#Omit the operation code here
	driver.close()#close the current tab
	driver.switch_to.window(driver.window_handles[1])#switch to the initial tab handle

[How to Fix]Element is not attached to the page document record

Record the click problem of the select box in automatic test

1. Paste the code first

#Open the Google Chrome
#input the Google
#Click the I'm feel Luckly
driver.find_element_by_css_selector("#tsf > div:nth-child(2) > div.A8SBwf > div.FPdoLc.tfB0Bf > center > input.RNmpXc").click();
# click about us
driver.find_element_by_css_selector("#nav-list > li:nth-child(2) > a").click();
#Cyclic click on select checkbox
for index in range(len(driver.find_elements_by_tag_name("option"))):
    select = driver.find_element_by_id("lang-chooser");
    select_value = select.find_elements_by_tag_name("option");

First, by_ tag_ The name method gets the option information in the select box, which is returned in the form of list


Then use the for loop to traverse the list of select options through the index number, and remove the current option of click ()
because each click on the select option will refresh the whole web page, an error will be reported

element is not attached to the page document

So we need to use it driver.refresh() method to refresh the current page, and then get the elements of the select option box again to click

Go: How to Fix plug-in installation failure in vscode of windows system

1.Run go env -w GO111MODULE=on //enable mod   
  Run go env -w GOPROXY=,direct //set proxy
2. Go to GOPATH directory, create src/ directory, go to src/ directory
    git clone
    git clone
3.Then you can install the go plugin in vscode as prompted (odds are it still won't work)
 So you need to execute the following command in the terminal of %GOPATH%/src directory
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
    go get -u -v
4.There may still be errors after performing the above steps, just follow the instructions prompted by vscode to fix them.

Note: There may be problems with the following:
    Error: go: cannot find main module; see 'go help modules'
    Solution go env -w GO111MODULE=off
GO111MODULE There are three values: off, on and auto (default).

GO111MODULE=off, no module support, find dependencies from $GOPATH and vendor folders.
GO111MODULE=on, with module support, go ignores the $GOPATH and vendor folders and only downloads dependencies based on go.mod.
GO111MODULE=auto, the go command line will decide whether to enable the modules feature based on the current directory.
There are two scenarios.
	module support is enabled when the project is outside of $GOPATH/src and the project root directory has a go.mod file.
	the project is inside $GOPATH/src and module support is not provided even if the go.mod file exists.

[How to Fix]No executorfactory found to execute the application

Error information

Cause of error

Starting from Flink 1.11, the dependency of flink-streaming-java on flink-clients has been removed and the clients dependency needs to be added manually.

How to Fix

Modify the POM file and add the Flink clients dependency


JavaScript removes the number specified in the array


Method 1: return a new array
/ / remove all elements in array arr whose values are equal to item. Do not modify the array arr directly, and the result will return a new array

function clearArrItem(arr,item){
	var arrs=[];
	for(var i = 0;i<arr.length;i++){
		if(arr[i] !== item){
	return arrs
var arrs = [1,2,5,4,2,1,5,2,1,2,5,42,1,4,11,1,1,1,1,11];


Method 2: operate in the original array
/ / remove all the elements in the array arr whose values are equal to the item, directly operate on the given arr array, and return the result
to the user**

function clearArrItem2(arr,item){
	var index;
	for(var i = 0;i<arr.length;i++){
		if(arr[i] === item){
			if(arr[i+1] === item){
	return arr;
var arrs = [1,5,6,3,5,4,1,1,1,1,1,1,1,5,8,4,5,1,5,1,5,1,1];


UTF-8 encoding error when starting robotframework ride

Record the error when starting the robot framework ride

start-up The following error occurred

D:\Program Files(x86)\python\Scripts>python
Traceback (most recent call last):
  File “D:\Program Files(x86)\python\lib\site-packages\robotide\application\ “, line 70, in OnInit
    self._ find_ robot_ installation()
  File “D:\Program Files(x86)\python\lib\site-packages\robotide\application\ “, line 124, in _ find_ robot_ installation
    str( os.path.dirname (rf_ file), ‘utf-8’))).publish()
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa3 in position 20: invalid start byte
OnInit returned false, exiting…
Error in atexit._ run_ exitfuncs:
wx._ core.wxAssertionError : C++ assertion “GetEventHandler() == this” failed at ..\..\src\common\ wincmn.cpp (478) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed



Check the log. UTF-8 can’t encode 20,

Therefore, we tried the next step The UTF-8 coding form in the file is changed to “GBK”, restart After that, ride is turned on

Cloning failed using an SSH key for authentication

Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to Name + time
to retrieve a token. It will be stored in “C”: / users / administrator / appdata / roaming / composer/ auth.json ” for future use by Composer.

Log in to GitHub and open the following link
Generate a token
and execute the following code

composer config --global --auth <token>

Correct writing

composer config --global --auth 441be92d716e*****853ec70ffa

Then read the error message in the newspaper


Is there any change in the following file? If so, there will be no problem,

error C4996: ‘inet_addr‘: Use inet_pton() or InetPton() instead or define _WINSOCK_D


Vs2015 appears when writing socket client. (this is the second time I have encountered this problem. Last time vs2017, I must remember it to facilitate myself to check in the future: P)

SOCKADDR_ IN ClientAddr;
ClientAddr.sin_ family = AF_ INET;
ClientAddr.sin_ addr.S_ un.S_ addr = inet_ addr(“”);
ClientAddr.sin_ Port = htons (port);
error c4996: ‘INET_ addr’: Use inet_ pton() or InetPton() instead or define _ WINSOCK_ DEPRECATED_ NO_ WARNINGS to disable deprecated API warnings


In the version after vs2013, INET is added_ New functions such as Pton () and inetpton () are used for IP address conversion between “dotted decimal” and “binary integer”, and can handle IPv4 and IPv6. And INET_ Addr is an old function. Higher version vs uses a new function by default when compiling, so this error will be reported.

[solution 1]

Replace INET with the new function suggested_ Addr function.

[solution 2]

Modify the vs configuration and tell it I want the old function

1. Modification method: Item – & gt; attribute – & gt; C / C + + – & gt; general – & gt; SDL check, change “yes” to “no”.
2. Property page of file_ CRT_ SECURE_ NO_ “Warnings” plus
– – –
copyright notice: This is CSDN blogger Rani_ The original article of “ZZ” follows CC 4.0 by-sa copyright agreement. Please attach the link of original source and this statement.
Link to the original text: 42731241/article/details/96143934