Configuring a Sample Project
- Obtain the huaweicloud-sdk-dis-c-XXX.zip development package from SDK Download and upload it to any directory in Linux. Go to the directory and run the unzip huaweicloud-sdk-dis-c-XXX.zip command to decompress the package. The package contains the dis-source folder (source code), sample folder (sample code), and third_party folder (third-party class) are displayed.
- Go to the dis-source/src directory and run the protoc-c --c_out=. httpbody.proto command. The httpbody.pb-c.c and httpbody.pb-c.h files are generated in the current directory.
- Return to the dis-source folder and run the make command to compile source codes.
The warning information generated during command execution will not adversely affect the program. After the command is executed, a build folder is generated to store the dynamic link library.
- Run the ./build.sh command.
The following information is displayed in the command output:
-bash: ./build.sh: /bin/bash^M: bad interpreter: No such file or directory
Run the following commands:
chmod 700 ./build.sh
vim build.sh
:set ff=unix
:wq!
The warning information generated during command execution will not adversely affect the program. After the command is executed, a dis_api folder is generated. Files in this folder are required for executing the sample code.
- Go to the sample folder and modify the DIS parameters in test.c, such as ak, sk, and projectId.
- Run the make command to compile the program and generate the executable file dis_bin.
- Run the ./dis_bin command to check the running result of the program.
Last Article: Preparing the Installation Environment
Next Article: Configuring an AK and SK
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.