unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Building with MSYS2 UCRT64
@ 2022-01-26 10:16 Loreno Heer
  2022-01-26 13:12 ` Eli Zaretskii
  2022-01-26 13:45 ` Arash Esbati
  0 siblings, 2 replies; 3+ messages in thread
From: Loreno Heer @ 2022-01-26 10:16 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there,

I can succesfully build emacs with MINGW64 (msvcrt) but if I try to
build it using UCRT64 (ucrt) I get a bunch of errors:

C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
C:\msys64\tmp\ccoT9xeo.o: in function `main':
C:\msys64\home\User\src\emacs\nt/cmdproxy.c:874: undefined reference to
`_snprintf'

...

Looks like _snprintf is not defined when using ucrt.

Not sure if this is a problem of emacs, msys or windows 7.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Building with MSYS2 UCRT64
  2022-01-26 10:16 Building with MSYS2 UCRT64 Loreno Heer
@ 2022-01-26 13:12 ` Eli Zaretskii
  2022-01-26 13:45 ` Arash Esbati
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2022-01-26 13:12 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Loreno Heer <helohe@bluewin.ch>
> Date: Wed, 26 Jan 2022 11:16:32 +0100
> 
> I can succesfully build emacs with MINGW64 (msvcrt) but if I try to
> build it using UCRT64 (ucrt) I get a bunch of errors:
> 
> C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccoT9xeo.o: in function `main':
> C:\msys64\home\User\src\emacs\nt/cmdproxy.c:874: undefined reference to
> `_snprintf'
> 
> ...
> 
> Looks like _snprintf is not defined when using ucrt.
> 
> Not sure if this is a problem of emacs, msys or windows 7.

I'm not aware of any support in Emacs for building with UCRT64.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Building with MSYS2 UCRT64
  2022-01-26 10:16 Building with MSYS2 UCRT64 Loreno Heer
  2022-01-26 13:12 ` Eli Zaretskii
@ 2022-01-26 13:45 ` Arash Esbati
  1 sibling, 0 replies; 3+ messages in thread
From: Arash Esbati @ 2022-01-26 13:45 UTC (permalink / raw)
  To: Loreno Heer; +Cc: help-gnu-emacs

Loreno Heer <helohe@bluewin.ch> writes:

> I can succesfully build emacs with MINGW64 (msvcrt) but if I try to
> build it using UCRT64 (ucrt) I get a bunch of errors:
>
> C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccoT9xeo.o: in function `main':
> C:\msys64\home\User\src\emacs\nt/cmdproxy.c:874: undefined reference to
> `_snprintf'
>
> ...
>
> Looks like _snprintf is not defined when using ucrt.
>
> Not sure if this is a problem of emacs, msys or windows 7.

I've never tried it, but acc. to this page[1], I'd say it is Win7:

--8<---------------cut here---------------start------------->8---
MSVCRT vs UCRT

These are two variants of the C standard library on Microsoft Windows.

MSVCRT (Microsoft Visual C++ Runtime) is available by default on all
Microsoft Windows versions, but due to backwards compatibility issues is
stuck in the past, not C99 compatible and is missing some features.

- It isn't C99 compatible, for example the printf() function family,
  but...
- mingw-w64 provides replacement functions to make things C99 compatible
  in many cases
- It doesn't support the UTF-8 locale
- Binaries linked with MSVCRT should not be mixed with UCRT ones because
  the internal structures and data types are different. (More strictly,
  object files or static libraries built for different targets shouldn't
  be mixed. DLLs built for different CRTs can be mixed as long as they
  don't share CRT objects, e.g. FILE*, across DLL boundaries.) Same rule
  is applied for MSVC compiled binaries because MSVC uses UCRT by
  default (if not changed).
- Works out of the box on every Microsoft Windows versions.

UCRT (Universal C Runtime) is a newer version which is also used by
Microsoft Visual Studio by default. It should work and behave as if the
code was compiled with MSVC.

- Better compatibility with MSVC, both at build time and at run time.
- It only ships by default on Windows 10 and for older versions you have
  to provide it yourself or depend on the user having it installed.
--8<---------------cut here---------------end--------------->8---

Best, Arash

Footnotes:
[1]  https://www.msys2.org/docs/environments/



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-26 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-26 10:16 Building with MSYS2 UCRT64 Loreno Heer
2022-01-26 13:12 ` Eli Zaretskii
2022-01-26 13:45 ` Arash Esbati

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).