Issues With Clang Locating C++ Libraries on M3 Chipset

I’m on a Macbook Pro 2023 with an M3 chip. I’ve been attempting to get Poco (and all of its library files) as well as libpq to be properly located by Clang while using a Makefile. All my attempts have failed. I know the Makefile is correct, as colleagues have been able to compile with it no problem on linux based systems.

I’ve installed both libraries (Poco and libpq) both through homebrew and vcpkg, as well as postgres libraries (through homebrew) and attempted several ways to create ways for clang to locate these files. I’ve found a way for Poco to be located, but not libpq/postgres. Additionally, from what I’ve read online, homebrew does not automatically put these files where they should be on Apple silicon, but will on Intel silicon.

I also have an issue with the linker and libpq as well, such that after being installed, and having found a work around (I do not want to use) it fails as well with the following output:

ld: library 'pq' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
  1. For Poco, I was able to create a symbolic link in /usr/local/include to ~/vcpkg/packages/poco_arm64-osx/include/Poco which locates the Poco libraries successfully.

  2. I attempted the same process for postgres and libpq (independently, they were never in /usr/local/include together at the same time), but clang fails to find libpq-fe.h even though I know it’s locations exactly… The below is where I’ve attempted symbolic links from within /usr/local/include using sudo ln -s path/to/library library-name

    • sudo ln -s /opt/homebrew/Cellar/postgresql@14/14.12/include/postgresql@14 postgresql@14
    • sudo ln -s /opt/homebrew/Cellar/libpq/16.3/include libpq
    • sudo ln -s /opt/homebrew/include/postgresql@14 postgresql@14
    • sudo ln -s ~/vcpkg/packages/libpq_arm64-osx/include libpq

The only way I have found to get 2 working is by adding an env var to my .bashrc file:
export CPLUS_INCLUDE_PATH="/opt/homebrew/Cellar/libpq/16.3/include/"

Though I’d rather not do this. One of my colleagues rightfully stated “it shouldn’t be this difficult.”

What can I do to ensure libpq is found by the compiler properly – as well as fixing the linker issue for libpq too – without modifying the Makefile or creating env vars.

New contributor

NAlexH2 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật