Author Nan Zhang
Recipients Nan Zhang
Date 2017-05-15.02:55:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
up vote
down vote
I am trying to build CPython3.6 from GitHub statically with the Documentation below:

Changed *shared* to *static*

And only uncommented the module "testcapimodule" in Modules/Setup file:

_testcapi _testcapimodule.c # Python C API test module

And ran with 'make LINKFORSHARED=" "'

However I got errors that:

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers   -I. -I./Include    -DPy_BUILD_CORE  -c ./Modules/_testcapimodule.c -o Modules/_testcapimodule.o
./Modules/_testcapimodule.c: In function ‘test_datetime_capi’:
        ./Modules/_testcapimodule.c:2191:9: error: ‘PyDateTimeAPI’ undeclared (first use in this function)
             if (PyDateTimeAPI) {
        ./Modules/_testcapimodule.c:2191:9: note: each undeclared identifier is reported only once for each function it appears in
        ./Modules/_testcapimodule.c:2203:5: error: ‘PyDateTime_IMPORT’ undeclared (first use in this function)
        ./Modules/_testcapimodule.c:2208:1: warning: control reaches end of non-void function [-Wreturn-type]
        make: *** [Modules/_testcapimodule.o] Error 1

But when I build Cpython3.6 with *shared*, it can succeed.
Date User Action Args
2017-05-15 02:55:39Nan Zhangsetrecipients: + Nan Zhang
2017-05-15 02:55:39Nan Zhangsetmessageid: <>
2017-05-15 02:55:39Nan Zhanglinkissue30367 messages
2017-05-15 02:55:37Nan Zhangcreate