I was following the guide in https://github.com/vim/vim/blob/master/src/INSTALLpc.txt
(Section 2 - Msys2 with MinGW)
I've installed msys2 and ran it through the mingw64 file in the msys64 directory, installed all dependencies, etc. I got until 2.4
2.4.
I navigated to the SRC folder of the vim 8.1 installation and ran the command, but I got this error when I run make -f Make_ming.mak GUI=no
$ make -f Make_ming.mak
g++ -I. -Iproto - ..[omitted].. -luuid
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/buffer.o:buffer.c:(.text+0xf01): undefined reference to `python3_buffer_free'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/eval.o:eval.c:(.text+0xea4): undefined reference to `set_ref_in_python3'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/evalfunc.o:evalfunc.c:(.text+0x4505): undefined reference to `python3_enabled'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/evalfunc.o:evalfunc.c:(.text+0x6990): undefined reference to `do_py3eval'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/evalfunc.o:evalfunc.c:(.text+0x7bd2): undefined reference to `do_py3eval'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/ex_cmds2.o:ex_cmds2.c:(.text+0x277d): undefined reference to `ex_py3file'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/ex_cmds2.o:ex_cmds2.c:(.text+0x2891): undefined reference to `ex_py3'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/ex_cmds2.o:ex_cmds2.c:(.text+0x28a1): undefined reference to `ex_py3do'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/ex_docmd.o:ex_docmd.c:(.rdata+0x4fa8): undefined reference to `ex_py3'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/ex_docmd.o:ex_docmd.c:(.rdata+0x4fc8): undefined reference to `ex_py3do'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/ex_docmd.o:ex_docmd.c:(.rdata+0x4fe8): undefined reference to `ex_py3'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/ex_docmd.o:ex_docmd.c:(.rdata+0x5008): undefined reference to `ex_py3file'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/main.o:main.c:(.text+0x2785): undefined reference to `python3_end'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/window.o:window.c:(.text+0x569a): undefined reference to `python3_window_free'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjx86-64/window.o:window.c:(.text+0x6117): undefined reference to `python3_tabpage_free'
collect2.exe: error: ld returned 1 exit status
make: *** [Make_cyg_ming.mak:1042: gvim.exe] Error 1
I am slowly losing my mind, I've spent 3 days trying to get this to compile. I've also tried approaches with windows-native mingw32 (chocolatey), tried cross-compiling from WSL ubuntu, compiling inside of msys2 instead of mingw64 terminal.. The purpose of this is to eventually compile a specific version of vim (8.1) with a specific version of python (3.7).
Here is what is installed on my msys:
$ pacman -Qqe
base
base-devel
filesystem
mingw-w64-x86_64-binutils
mingw-w64-x86_64-crt-git
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc-ada
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-gcc-libgfortran
mingw-w64-x86_64-gcc-libs
mingw-w64-x86_64-gcc-objc
mingw-w64-x86_64-gdb
mingw-w64-x86_64-gdb-multiarch
mingw-w64-x86_64-headers-git
mingw-w64-x86_64-libgccjit
mingw-w64-x86_64-libmangle-git
mingw-w64-x86_64-libwinpthread-git
mingw-w64-x86_64-make
mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-tools-git
mingw-w64-x86_64-winpthreads-git
mingw-w64-x86_64-winstorecompat-git
msys2-runtime
and the locations/versions of my compilers
C:\tools\msys64\mingw64\bin\mingw32-make.exe
C:\tools\msys64\mingw64\bin\gcc.exe
C:\tools\msys64\mingw64\bin\g++.exe
I most often refuse to request help unless I am extremely desperate and out of options, so I apologize if this question was written poorly or difficult to understand.
It seems that in Python 3.9, _Py_DEC_REFTOTAL was removed completely without any substitute. Thread (redhat.com). It will not build certain versions of vim. I installed Python3.6 through chocolatey, and everything compiled and linked perfectly.
For future reference, first install a version of python3 that works
(choco install python --version=3.6.7)
then use this in mingw64 shell in src folder of vim:
> mingw32-make -f Make_ming.mak PYTHON3=C:/Python36
PYTHON3_HOME=C:/Python36 PYTHON3INC=-IC:/Python36/include DYNAMIC_PYTHON3=yes
PYTHON3_VER=36 DYNAMIC_PYTHON3_DLL=libpython36.dll
STATIC_STDCPLUS=yes
Related
I am trying to install HTK using Cygwin (32 bit) on a x86_64 computer build. This is part of the error I get when running
./configure
make all
gcc = 5.4.0, g++ = 5.4.0, perl = 5; I have X11 folder in C:/cygwin/usr/share
Let me know if I should post the entire error of the make file.
HSLab.c: In function ‘FileExists’:
HSLab.c:1209:12: warning: variable ‘isEXF’ set but not used [-Wunused-but-set-variable]
Boolean isEXF; /* File name is extended */
^
/tmp/ccZO1TK3.o: In function InitBar':
/cygdrive/c/users/stevenha29/My Documents/htk/HTKTools/HSLab.c:344: undefined reference toHTextWidth'
/cygdrive/c/users/stevenha29/My Documents/htk/HTKTools/HSLab.c:348: undefined reference to HSetColour'
/cygdrive/c/users/stevenha29/My Documents/htk/HTKTools/HSLab.c:349: undefined reference toHTextHeight'
/cygdrive/c/users/stevenha29/My Documents/htk/HTKTools/HSLab.c:349: undefined reference to HPrintf'
/cygdrive/c/users/stevenha29/My Documents/htk/HTKTools/HSLab.c:350: undefined reference toHSetGrey'
/cygdrive/c/users/stevenha29/My Documents/htk/HTKTools/HSLab.c:351: undefined reference to `HFillRectangle'
Run
./configure --without-x --disable-hslab
to disable Xlib and HSLab
Overall, Cygwin is a bad idea, it is better to use Linux, you can install it in Virtualbox.
This question already has answers here:
Multiple glibc libraries on a single host
(11 answers)
Closed 7 years ago.
The distribution glibc version is 2.11.3. I compiled the version 2.22 into /usr/glibc/.
Running make for a new curl version 7.46 I receive this errors:
/usr/glibc/lib/libpthread.so.0: undefined reference to `__mktemp#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__tfind#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__tdelete#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__twalk#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__call_tls_dtors#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__madvise#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `memcpy#GLIBC_2.14'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__getrlimit#GLIBC_PRIVATE'
/usr/glibc/lib/libresolv.so.2: undefined reference to `__sendmmsg#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__ctype_init#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__h_errno#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__tsearch#GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__libc_vfork#GLIBC_PRIVATE'
I am convinced it must be a problem because of the new glibc version but my linux knowledge is too weak to provide the correct path to the new glibc version.
What am I doing wrong? Thx!
There were several issues:
glibc 2.22 - distribution version is 2.11.3
openssl 1.0.2f - distribution version is 0.9.8j [from 2009!]
curl 7.46.0 - distribution version is 7.19.7
libmemcached with active sasl version from distribution
I am using all these libraries in my CUDA project and due the fact I wanted to update all these libraries to the newest version these steps were to do:
glibc: build into /usr/glibc
openssl: build into /usr/glibc/openssl-curl/. Before run export $LDFLAGS=-L/usr/glibc/lib
curl: run ./configure --prefix=/usr/glibc/openssl-curl/ --with-ssl=/usr/glibc/openssl-curl/ --disable-ldap - very important: $LDFLAGS must be empty when running configure because the script adds the value to $LD_LIBRARY_PATH and due the version mismatch of the new glibc and the distribution version all programs crash with segmentation fault. Before make run again export $LDFLAGS=-L/usr/glibc/lib.
For my project I had also to rebuild libmemcached with the new glibc version with this command: ./configure --prefix=/usr/local/libmemcached --disable-sasl
In CUDA I have to set the path to the new libraries and now all works. It is also very important the linker options -Wl,--rpath=/usr/glibc/lib and -Wl,--dynamic-linker=/usr/glibc/lib/ld-linux-x86-64.so.2 are set in order the new glibc version is loaded.
For my linux system I must not add in /etc/ld.so.conf the path /usr/glibc/lib otherwise the whole system crashes.
I'm working on a C program for getting events from Udev. The program has been compiled and tested on a host running Debian (With GCC 4.7.2-5).
Recently, switched to Ubuntu 12.04 LTS (With GCC 4.6.3). The same program fails to compile and halts during the linking phase.
automounter_main.c:(.text+0xd4e): undefined reference to `udev_new'
automounter_main.c:(.text+0xe02): undefined reference to `udev_device_new_from_devnum'
automounter_main.c:(.text+0xeb0): undefined reference to `udev_device_new_from_syspath'
automounter_main.c:(.text+0xf63): undefined reference to `udev_device_get_sysattr_list_entry'
automounter_main.c:(.text+0xf77): undefined reference to `udev_list_entry_get_name'
automounter_main.c:(.text+0xf85): undefined reference to `udev_device_get_sysattr_value'
automounter_main.c:(.text+0x100a): undefined reference to `udev_device_get_sysattr_value'
automounter_main.c:(.text+0x1055): undefined reference to `udev_device_get_sysattr_value'
automounter_main.c:(.text+0x1078): undefined reference to `udev_list_entry_get_next'
automounter_main.c:(.text+0x108c): undefined reference to `udev_device_get_parent'
automounter_main.c:(.text+0x1118): undefined reference to `udev_device_unref'
automounter_main.c:(.text+0x1122): undefined reference to `udev_unref'
The following steps were taken, but nothing seems to work.
Install all packages related to udev (udev, libudev-dev, libudev0). All the packages are reported to be the latest.
Create a Symlink in /usr/lib pointing the correct udev library.
Upgraded libc package
Symlink was verified using:
$ ls -l libudev*
lrwxrwxrwx 1 root root 39 Nov 27 15:57 libudev.so -> /lib/x86_64-linux-gnu/libudev.so.0.13.0)
Kindly help me find a way to resolve this error.
Thanks in advance.
My guess would be that you need to move -ludev to the end of the linking command line.
I'm currently trying to compile suricata (http://suricata-ids.org/) with luajit support on my arch linux distribution with these commands:
./configure --enable-luajit --with-libpcap-includes=/usr/local/pfring/include \
--with-libpcap-libraries=/usr/local/pfring/lib --with-libnss-libraries=/usr/lib \
--with-libnss-includes=/usr/include/nss/ --with-libnspr-libraries=/usr/lib \
--with-libnspr-includes=/usr/include/nspr \
--with-libluajit-includes=/usr/local/include/luajit-2.0/ \
--with-libluajit-libraries=/usr/lib/
then:
make
but I get the following errors when I make the project:
detect-luajit.o: In function `LuaDumpStack':
detect-luajit.c:(.text+0x46e): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitMatchBuffer':
detect-luajit.c:(.text+0x5d6): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0x6b9): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0x7d5): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitMatch':
detect-luajit.c:(.text+0xaac): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0xde4): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0xf00): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitThreadInit':
detect-luajit.c:(.text+0x1864): undefined reference to `lua_pcallk'
detect-luajit.o: In function `DetectLuaSetupPrime':
detect-luajit.c:(.text+0x1fe7): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0x2167): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0x24bf): undefined reference to `lua_pcallk'
collect2: error: ld returned 1 exit status
make[2]: *** [suricata] Error 1
I first though it was an issue coming from the lua version. So I tried to install both the lua 5.1.5 and 5.2.2, remaking the library and symbolic links as well, and nothing worked.
Thanks for your help
In Debian and Ubuntu, the library files are installed into /usr/lib/x86_64-linux-gnu/. If arch does the same, your configure line should include: --with-libluajit-libraries=/usr/lib/x86_64-linux-gnu/
I've spent quite a bit of time trying to get an expat based sample program to compile.
I was receiving the following error message when I tried to compile
gcc -Wall -lexpat line.c -o blah
line.c: In function ‘main’:
line.c:99:8: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘XML_Size’ [-Wformat]
/tmp/ccUa3vfD.o: In function `printcurrent':
line.c:(.text+0x42): undefined reference to `XML_SetDefaultHandler'
line.c:(.text+0x4d): undefined reference to `XML_DefaultCurrent'
line.c:(.text+0x60): undefined reference to `XML_SetDefaultHandler'
/tmp/ccUa3vfD.o: In function `main':
line.c:(.text+0x162): undefined reference to `XML_ParserCreate'
line.c:(.text+0x1ad): undefined reference to `XML_UseParserAsHandlerArg'
line.c:(.text+0x1c9): undefined reference to `XML_SetElementHandler'
line.c:(.text+0x1dd): undefined reference to `XML_SetCharacterDataHandler'
line.c:(.text+0x1f1): undefined reference to `XML_SetProcessingInstructionHandler'
line.c:(.text+0x2b2): undefined reference to `XML_Parse'
line.c:(.text+0x2c2): undefined reference to `XML_GetErrorCode'
line.c:(.text+0x2ca): undefined reference to `XML_ErrorString'
line.c:(.text+0x2d8): undefined reference to `XML_GetCurrentLineNumber'
collect2: ld returned 1 exit status
I had already run the following commands:
sudo apt-get install expat libexpat1 libexpat1-dev libxmltok1-dev
So I messed around for ages, trying to get the error message to go away so I could compile this (simple) little program, but to no avail.
Eventually, out of sheer randomness, I decided to switch to a Virtual Terminal.
I ran exactly the same command, this time it worked without a problem.
Can anyone tell me why this is? Is there something I need to run in order to refresh the library paths?
The linker line (i.e. the flags you give with -l and your input file names) are order-dependent. Libraries are only used to define functions used on their left side, but not on their right. Use:
gcc -Wall line.c -lexpat -o blah
See the question library is linked but reference is undefined for more information.