Hello Everyone!
I'm trying to compile a Camera shader for Arnold v6 on Linux and have cleared all the compile errors from the old v4 code (I think) that I picked up!
Now I'm getting this link error that I don't understand,
In file included from /software/apps/arnold/6.1.0.1/cent7.x86_64/include/ai.h:33:0,
from fCameraShader.cpp:1:
/software/apps/arnold/6.1.0.1/cent7.x86_64/include/ai_cameras.h:115:13: warning: ‘bool CameraReverseRay(const AtNode*, const AtVector&, float, AtVector2&)’ used but never defined [enabled by default]
static bool CameraReverseRay(const AtNode* node, const AtVector &Po, float relative_time, AtVector2 &Ps)
^
/software/apps/arnold/6.1.0.1/cent7.x86_64/include/ai_cameras.h:59:1: note: in expansion of macro ‘camera_reverse_ray’
camera_reverse_ray; \
^
fCameraShader.cpp:10:1: note: in expansion of macro ‘AI_CAMERA_NODE_EXPORT_METHODS’
AI_CAMERA_NODE_EXPORT_METHODS(VRCameraMethods);
^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/ccDdbLFd.o:(.data+0x38): undefined reference to `CameraReverseRay(AtNode const*, AtVector const&, float, AtVector2&)'
collect2: error: ld returned 1 exit status
make: *** [target] Error 1
Iv'e only managed to find mentions of 'CameraReverseRay' in ai_cameras.h which is part of the defines.
My build command so far looks like this,
gcc -std=c++11 -I$(ARNOLD_PATH)/include -L$(ARNOLD_PATH)/bin -L./ -lm -lai -loptix -lAdClmHub -lAdskLicensingSDK -lAdpSDKWrapper-arnold -dynamiclib fCameraShader.cpp -o fCameraShader.so
Here's the full shader source, https://pastebin.com/hD3CNZTz
Does anyone know how to resolve this?
Cheers
Fred