Problem using open for spidev

I want to use SPI to talk to a motor controller, but it seems that there is a missing dependency for “open” in “fcntl.h”. Bazel compiles fine, but when running I get the error

2020-02-06 12:01:02.309 ERROR engine/alice/backend/modules.cpp@250: eclipse-workspace/selfBalancing/ /home/phquanta/.cache/bazel/_bazel_phquanta/ddb5fd8cb60e7231f736a26c1999d66e/execroot/com_nvidia_isaac/bazel-out/k8-opt/bin/eclipse-workspace/selfBalancing/selfBalancing.runfiles/com_nvidia_isaac//eclipse-workspace/selfBalancing/ undefined symbol: _ZN5isaac13StepperDriver2fdE
2020-02-06 12:01:02.309 PANIC engine/alice/backend/modules.cpp@252: Could not load all required modules for application

This only occurs when the line

fd = open(device, O_RDWR);

is included in the c++. Is there a known way to get this working? It will use linux/spi/spidev.h later in the code as well, will that need to be specified as a dep as well? Thanks

I think this was the same problem as post I had declared a new public function in the class (transfer), but it must have been an issue when I defined it in the cpp. Moving it outside of the class fixed everything with the symbol errors. Ill figure out why I couldn’t define it later, it works for now.