#Is Cygwin not a Windows platform rather than a Unix variant?

1 messages · Page 1 of 1 (latest)

pure haven
summer lodge
#

It's complicated. People writing software usually only recognize a handful of platforms, usually 1. macOS, 2. Linux with GCC and Glibc and 3. Win32 with a specific version of Visual Studio. In reality, there are many other platforms that are similar in some regards and different in others.

#

Cygwin is a platform which:

  • uses the LP64 integer model (like Linux)
  • uses PE executables and dynamic libraries (like Windows)
  • uses Newlib as its C runtime (which is rare)
  • complies with a big portion of POSIX (Linux complies more, Win32 complies significantly less)
    etc.
pure haven
#

I use cygwin to build my C++ source code. cygwin don't call its Newlib, why?

summer lodge
#

What do you mean it doesn't "call its Newlib"?

prime latch
pure haven
prime latch
prime latch
#

or maybe you can say cygwin is a port of newlib to windows (but included within the official newlib source?), and then they rebranded the name to Cygwin. but most of the time when people talking about cygwin i think they are talking about the cygwin distribution (cygwin1.dll with all other unix utility goodies), instead of just the library.

prime latch
prime latch
summer lodge
pure haven
#

Can I build my C++ source code without Newlib?

summer lodge
#

I'm not sure. I think C++ code doesn't normally use the C runtime.

prime latch
prime latch
forest palm
#

Like malloc to implement new, or some other features

prime latch
forest palm
#

Okay

pure haven
#

@prime latch please do not use short word. where are you from?

prime latch
summer lodge
#

Hmm. libc++ website says "Only glibc-2.24 and later and no other libc is officially supported" on Linux. The manual for libstdc++ mentions malloc() quite a lot.
I'm starting to believe that C++ code actually relies on the C runtime.

pure haven
#

Before I read C++ father books, he recommand we do not use malloc directly.

if windows can use glibc, it will save me much time.

prime latch
pure haven
#

I need to read more C++ standard library code.

forest palm
#

If he's saying "don't use malloc in C++" then it's not that unreasonable
But I don't agree with the advice "use new" either

prime latch
muted hedge
rotund crow
#

this is very interesting

rotund crow
forest palm
summer lodge
#

I can definitely appreciate that building new stuff from ground up will often just end up rediscovering old problems and old solutions to them, but not everything. For example if CMake and Ninja don't want to support "dead" platforms with non-conforming headers, tools and libraries, they can avoid a bunch of Autotools's complexity.