How is 618 sales champion made?Uncover the secret of e-commerce’s “invigorating” hundreds of millions of sales data>>>
Recently, in the process of compiling the source code of ortp under Linux, we encountered the following problems, and we did not find a good solution on the Internet. However, after some attempts, the problem was finally solved. Here is a note~~~
Error: format not a string literal and no format arguments
The error occurred in the following environment:
Key point: the compiled file contains the following forms of code:
char*pTestStr=”thisisatest!”;
printf(pTestStr);
And when compiling the above code in Ubuntu, it is easy to get compilation errors
Solution:
Change the printf (pteststr) statement to:
printf(“%s”,pTestStr);
My system is Ubuntu 9.10, and the GCC version is 4.4.1, which may be caused by the strict code checking of this GCC version
Concluding remarks
Learn more excellent courses for free and log in to the official website of Lebo college http://www.learnbo.c/
Or follow our official microblog and wechat, there are more surprises~
This article is from “jhuster’s column” blog, please keep this source http://ticktick.blog.51cto.com/823160/311614
Similar Posts:
- C Compilation Error: implicit declaration of function xxx is invalid in C99 [-Wimplicit-function-declaration]
- arm-linux-gnueabihf-g++: error trying to exec ‘cc1plus’: execvp: No such file or directory
- LINK : fatal error LNK1123 (VS2010)
- Error lnk2026: module unsafe for safeseh image
- The solution of “no matching function for call to…” in G + + compilation
- Error: could not insert module hello_ world.ko: Invalid module format
- Gitlab-error: RPC failed; result=22, HTTP code = 500 settlement
- Linux: Environment Variables C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, CPATH Common Error [How to Solve]
- [Solved] error: aggregate value used where an integer was expected
- Error reason for adding PNG pictures in Android studio