building vim with clang and python3 support

54 views
Skip to first unread message

N i c o l a s

unread,
May 31, 2023, 1:50:46 PM5/31/23
to vim_dev
Hi,

From vim.9.0.1594 source, I obtain this error trying to build gvim HUGE version under win10 with python3(12) support.


c -Wl,-Bdynamic -lgcc_eh -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic -lole32 -luuid
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa07b): undefined reference to `__imp_PyLong_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa088): undefined reference to `__imp_PyBool_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa644): undefined reference to `__imp_PyLong_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa64d): undefined reference to `__imp_PyBool_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa6c4): undefined reference to `__imp_PyLong_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa6cd): undefined reference to `__imp_PyBool_Type'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: [Make_cyg_ming.mak:1126: gvim.exe] Error 1 (ignored)


My FLAGS are these :

* CC=clang CXX=clang++ -pipe OLE=yes GUI=yes XPM=no DIRECTx=yes   ASAN=no   DYNAMIC_LUA=yes LUA=./lua-5.4.6/src LUA_VER=54   PYTHON3=D:/Python312 DYNAMIC_PYTHON3=yes PYTHON3_VER=312   -I /d/python312/include   DYNAMIC_PYTHON3_DLL=python312.dll    RUBY=D:/Ruby32-x64 DYNAMIC_RUBY=yes RUBY_VER=32 RUBY_API_VER_LONG=3.2.0   -I/d/Ruby32-x64/include/ruby-3.2.0/ruby SODIUM=yes TERMINAL=yes EVENT_LOOP=yes   STATIC_STDCPLUS=yes WINVER=0x0A00

The install_PC.txt file just tell that for a clang compilation :

    CC=clang
    CXX=clang++
    make -f Make_ming.mak DEBUG=yes ASAN=yes

Thank you for help

Ken Takata

unread,
Jun 1, 2023, 7:57:57 AM6/1/23
to vim_dev
Hi,

So, you are using the beta version of python 3.12, right?
Then, if_python3.c should be updated to support python 3.12, I think.

Regards,
Ken Takata

2023年6月1日木曜日 2:50:46 UTC+9 N i c o l a s:

N i c o l a s

unread,
Jun 1, 2023, 8:20:19 AM6/1/23
to vim...@googlegroups.com
Yes right. That's the way to go. 
Thank you Ken. 

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/Epoifw56POA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/73ae1253-405e-4503-96ef-08cd0278be69n%40googlegroups.com.

N i c o l a s

unread,
Jun 2, 2023, 4:12:28 PM6/2/23
to vim_dev
Hi Ken,

From this commit fee511c in line 703 of if_python3.c if there is an update for versions of python upper to 3.11.
#  if PY_VERSION_HEX >= 0x030b00b3
#   undef PyObject_TypeCheck
#   define PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
#  else
#   define _PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
#  endif
# endif          

I don't understant why I got this error for this object apparently not known.
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa07b): undefined reference to `__imp_PyLong_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa088): undefined reference to `__imp_PyBool_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa644): undefined reference to `__imp_PyLong_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa64d): undefined reference to `__imp_PyBool_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa6c4): undefined reference to `__imp_PyLong_Type'
D:/msys64/mingw64/bin/ld: gobjx86-64/if_python3.o:if_python3.c:(.text+0xa6cd): undefined reference to `__imp_PyBool_Type'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: [Make_cyg_ming.mak:1126: gvim.exe] Error 1 (ignored)
clang -I. -Iproto -DWIN32 -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_STDINT_H -DMS_WIN64 -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_OLE -DFEAT_CSCOPE -DFEAT_N
Reply all
Reply to author
Forward
0 new messages