简体   繁体   中英

Visual Microsoft Visual C++ Compiler for Python 2.7 vs MinGW

I am making some functions in c which I am going to call from Python via Cython. I am developing these functions in Code:Block using MinGW C++ compiler. But when building them for Python I have to use Visual Microsoft Visual C++ Compiler for Python 2. Then I have met a strang problem. When compiling with Visual C++ compiler I have after a lot of trial and fail found out that all variables have to be decleared before first in each block (if, for, function). Why is so. Are there difference between compilers for c?

MSVC mostly adheres to the original C89 spec. In later revisions of the language this restriction has been lifted.

在C语言中(适当的C语言而不是C ++语言),变量必须在块的开头声明。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM