blkpingu
blkpingu

Reputation: 1676

How do I install libuuid with Homebrew on MacOS 11.1?

I'm aware there is a macports libuuid package, however AFAIK it's not safe to use homebrew and macports on the same machine.

This answer seems outdated. I say that because when I use brew install ossp-uuid make doesn't like it, despite seeming to find uuid.h.

What is the current and up to date homebrew package to install libuuid on mac?

Alternatively, could one build libuuid from source and if yes, how?

Upvotes: 2

Views: 928

Answers (2)

davernator
davernator

Reputation: 230

I was porting an app from Linux to MacOS Monterey (could apply to 11.1 (Big Sur) as well).

The link was failing on libuuid, even though it compiled ok as on Linux.

I finally got my build to link, having 'homebrew install'ed ossp-uuid with homebrew version 3.6.4, under Monterey (12.5.1).

I first heard of ossp-uuid in this thread (thanks ).

I had tried several things before. It compiled ok, but did not link. brew install ossp-uuid fixed that (homebrew 3.6.4), and brew set up the requisite links to find the library under /usr/local/lib .

I left the source code as #include <uuid/uuid.h>, in this particular case.

Upvotes: 1

blkpingu
blkpingu

Reputation: 1676

I was made aware that libuuid is already part of macOS.

It was therefore enough to just add an OS specific include.

#if __APPLE__
    #include <uuid/uuid.h>
#else
    #include <uuid.h>
#endif

Upvotes: 2

Related Questions