In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about the use of CMQ message queues in the Windows environment. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
This configuration rule is a configuration tutorial in Windows environment, and will be supplemented in time if there is any new content.
1. Environment configuration: operating system Windows7 Enterprise Edition memory 8G2. Software version: Visual Studio2015CMake3.6.1CMQ--
Choose your own language version of SDK (download address), here I choose
The choice is that C++ version of SDK,SDK itself does not have platform dependence, Linux and Windows can be.
one。 The environment depends on 1. Download Curl
To use CMQ SDK, you need to generate two library files, and the SDK library files depend on the curl library files.
First, download the Windows version of curl (download link), which
Make a choice according to your environment. If the request uses https, be sure to choose the version with SSL. This case
The selection is as follows.
Decompress directly after the download is completed.
two。 Install CMake
The version of CMake must be selected to support your own development environment. In this case, the development tool VS2015 is selected and downloaded directly.
The latest version of CMake is available (download address)
Download CMake and install it. After installation, open cmake-gui.exe, as follows:
Description:
Here, select the decompressed path of the previously downloaded curl
This Browse Build is the path to the generated curl library file. Just create one of your own.
Select your own version of the development tool here, click Configure, and select the version of your development tool (vs2015 is selected in this case, and be sure to correspond here. If not, it is recommended to choose another version of CMake, the vs2010 I used before, and select CMake version 2.8.12. I did not find the corresponding development tool. Later, I can directly upgrade to VS2015 and download the latest CMake.)
Note:
If SSH is not practical here, it is recommended to uncheck it.
Be sure to check this option and generate a static library to use later.
After the configuration is completed, click Generate to generate the library file of Curl. SDK depends on curl, so generate the library of curl.
SDK call.
two。 Generate library file 1. Empty project
Create a new project using the VS platform (it is recommended to select an empty project) to generate the CMQ C++ SDK static library and dynamic library
Pieces:
After building the project, import all source files and header files in the attachment src directory (including the header files in the json folder)
Also before downloading the curl.h file inside the decompressed curl), after the import is completed, the project structure is like the figure above.
Then right-click the → property → configuration property → General on the project name:
Generate a static library and select the configuration type (.lib).
two。 Then import the curl header file
After that, select CumberCraft + → regular → to attach the include directory:
The decompressed path of the curl downloaded by yourself
There is a curl.h file under include, so this path also needs to be added.
3. Import the generated curl library file
This additional library directory is the path of the previously generated curl library file. Here I provide a library file generated by myself, straight
Just take it and use it.
Action: library manager → regular → attach dependency → libcurl_imp.lib (this is the curl library file I generated myself
You can use it directly under the same environment) → confirm
And note that it is added to the processor item:
4. Generate static libraries (lib)
Right-click → generation on the project name to generate the CMQ C++ SDK static library file.
5. Generate a dynamic library (dll)
Change the project configuration type:
The operation flow after that is basically the same as that of the static library. Check whether all the additional items and additional dependencies are
Add complete! Be sure to check here, because after changing the configuration type, some items need to be re-added.
Under Dll configuration type, additional library directories and additional dependencies belong to different editing pages:
At this point, after all the configuration modifications are completed, the project name → right-clicks the → build (if you rebuild, it will change the previous lib
Delete the library).
three。 CMQ SDK usage
In the projects that need to use cmq, add the header file path and library file path of cmq C++ sdk, and attach
Input cmq C++ sdk static library into the dependency library
The generated dynamic library path needs to be added to the system PATH path, or the generated dynamic library can be copied to the program.
Under the current path of the order.
This is how the CMQ message queue shared by the editor is used in the Windows environment. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.