Remember to search before filing a new report
Zig Version
0.9.0-dev.1679+6cf8a49bb
Steps to Reproduce
This problem can be reproduced by building and executing C interoperability example. The problem was observed on a MacBook Pro MacOS Big Sur (Intel). zig build-exe doesn't seem to be able to search system include paths across symbolic links. When using a package manager like Homebrew, it only uses symbolic links to separate Homebrew installations and build directories from the system search paths, while avoiding the need for Superuser privileges for installing software.
Using Homebrew install raylib and zig.
brew install --HEAD zig
brew install --HEAD raylib
This should build hello-raylib executable, but it doesn't.
zig build-exe --library raylib hello-raylib.zig
With Homebrew, raylib headers would be searched for in /usr/local/include. The headers are really symbolically linked to a Cellar directory e.g. /usr/local/include/raylib.h -> ../Cellar/raylib/HEAD-3a9f089/include/raylib.h, which is different for each version. In this case the version is the master HEAD at commit point 3a9f089.
If you specify a zip build-exe by adding the actual header and library locations (thus avoiding travelling over symbolic links), it builds.
zig build-exe -I/usr/local/Cellar/raylib/HEAD-3a9f089/include -L/usr/local/Cellar/raylib/HEAD-3a9f089/lib --library raylib hello-raylib.zig
This problem doesn't happen when using the zig build command either.
Attached is the raylib hello world code. I've added a .txt because github doesn't support uploading zig files in issues.
hello-raylib.zig.txt
Expected Behavior
I expected a zig-cache directory and a hello-raylib executable. When the executable is run, a basic window pops up with Hello World!

Actual Behavior
zig build-exe --library raylib hello-raylib.zig
./hello-raylib.zig:1:13: error: C import failed
const ray = @cImport({
^
zig-cache/o/f1f056f0c5fb85b4fa0abc416fd3c51d/cimport.h:1:10: note: 'raylib.h' file not found
#include <raylib.h>
^
./hello-raylib.zig:9:5: note: referenced here
ray.InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
Remember to search before filing a new report
Zig Version
0.9.0-dev.1679+6cf8a49bb
Steps to Reproduce
This problem can be reproduced by building and executing C interoperability example. The problem was observed on a MacBook Pro MacOS Big Sur (Intel). zig build-exe doesn't seem to be able to search system include paths across symbolic links. When using a package manager like Homebrew, it only uses symbolic links to separate Homebrew installations and build directories from the system search paths, while avoiding the need for Superuser privileges for installing software.
Using Homebrew install raylib and zig.
brew install --HEAD zigbrew install --HEAD raylibThis should build hello-raylib executable, but it doesn't.
zig build-exe --library raylib hello-raylib.zigWith Homebrew, raylib headers would be searched for in
/usr/local/include. The headers are really symbolically linked to a Cellar directory e.g./usr/local/include/raylib.h -> ../Cellar/raylib/HEAD-3a9f089/include/raylib.h, which is different for each version. In this case the version is the master HEAD at commit point 3a9f089.If you specify a zip build-exe by adding the actual header and library locations (thus avoiding travelling over symbolic links), it builds.
zig build-exe -I/usr/local/Cellar/raylib/HEAD-3a9f089/include -L/usr/local/Cellar/raylib/HEAD-3a9f089/lib --library raylib hello-raylib.zigThis problem doesn't happen when using the
zig buildcommand either.Attached is the raylib hello world code. I've added a .txt because github doesn't support uploading zig files in issues.
hello-raylib.zig.txt
Expected Behavior
I expected a
zig-cachedirectory and ahello-raylibexecutable. When the executable is run, a basic window pops up with Hello World!Actual Behavior