Community
Arnold General Rendering Forum
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Undefined reference to `CameraReverseRay shader Error - Arnold v6 shader

8 ANTWORTEN 8
GELÖST
Antworten
Nachricht 1 von 9
Fred_Blueroom
701 Aufrufe, 8 Antworten

Undefined reference to `CameraReverseRay shader Error - Arnold v6 shader

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

Tags (1)
Beschriftungen (1)
8 ANTWORTEN 8
Nachricht 2 von 9
Stephen.Blair
als Antwort auf: Fred_Blueroom

I don't have an answer for the link error, but I don't think you need this stuff for a shader:

-loptix -lAdClmHub -lAdskLicensingSDK -lAdpSDKWrapper-arnold 





// Stephen Blair
// Arnold Renderer Support
Nachricht 3 von 9
Fred_Blueroom
als Antwort auf: Stephen.Blair

Ok, thanks! I got link errors saying I needed them but maybe there's something triggering that that is not needed now. The code I believe was written for V4 and maybe that's changed things.

Nachricht 4 von 9
Stephen.Blair
als Antwort auf: Fred_Blueroom

Do you have camera_create_ray() in fCameraShader.cpp ?

If not, if you put in something, like the one from this example, do you still get the same link errors?
https://docs.arnoldrenderer.com/x/TwAnAg



// Stephen Blair
// Arnold Renderer Support
Nachricht 5 von 9
Fred_Blueroom
als Antwort auf: Stephen.Blair

Thanks for that link.
I tried to compile that instead. First by removing the extra libs you pointed to but I then got pages of errors. Then I tried with and I didn't get the CameraReverseRay error.
But I did get a link error,

/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [test] Error 1


Nachricht 6 von 9
Fred_Blueroom
als Antwort auf: Fred_Blueroom

Sorry my comment replies are getting removed by the system somehow.

Testing like this instead.

Thanks for the small camera example I tried to compile that instead and then I didn't get the CameraReverseRay error. One difference I see is that your example has both 'camera_create_ray' and 'camera_reverse_ray', whilst the code im using only has the 'camera_create_ray'. Maybe it needs something for the reverse ray too?

But unfortunately I still get a build error with the example code,

/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [test] Error 1


Nachricht 7 von 9
Fred_Blueroom
als Antwort auf: Fred_Blueroom

Awesome thanks for your help. I'll study that example and see what I'm doing different.

Cheers!

Nachricht 8 von 9
thiago.ize
als Antwort auf: Fred_Blueroom

https://docs.arnoldrenderer.com/display/A5ARP/Creating+a+Simple+Plugin has instructions for how to build. Note the suggestion of -shared.

Nachricht 9 von 9
Fred_Blueroom
als Antwort auf: thiago.ize

Thanks a lot that helped me!
I had to also add '-fpic'

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report