mic Posted May 25, 2009 Share Posted May 25, 2009 hello i started studying RiFilters - http://www.hosok2.com/project/dataExpansio...iFilter.cpp.txt (from this research: http://www.hosok2.com/project/dataExpansio...xpansion_2.html ) when compiling i got an error: error LNK2019: unresolved external symbol _RiSphere referenced in function "private: static void __cdecl My_RifPlugin::coneV(float,float,float,int,char * * const,void * * const)" (?coneV@My_RifPlugin@@CAXMMMHQAPADQAPAX@Z) if the string RiSphere(radius,-radius,radius,tmax,NULL); is deleted - everything is ok, test.dll is compiled. tell me please what's the reason?..) Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 25, 2009 Share Posted May 25, 2009 hello i started studying RiFilters - http://www.hosok2.com/project/dataExpansio...iFilter.cpp.txt (from this research: http://www.hosok2.com/project/dataExpansio...xpansion_2.html ) when compiling i got an error: error LNK2019: unresolved external symbol _RiSphere referenced in function "private: static void __cdecl My_RifPlugin::coneV(float,float,float,int,char * * const,void * * const)" (?coneV@My_RifPlugin@@CAXMMMHQAPADQAPAX@Z) if the string RiSphere(radius,-radius,radius,tmax,NULL); is deleted - everything is ok, test.dll is compiled. tell me please what's the reason?..) I haven't looked at your references, but that error message is saying that the symbol 'RiSphere' (called by the function coneV(), which is a member of the struct/class 'My_RifPlugin') is unresolved (meaning it can't find it). It's been a while since I've used the Ri library, but I believe RiSphere is defined in ri.h, isn't it? So... you probably just forgot to #include <ri.h> ? (and then link with the Ri library of course). Quote Link to comment Share on other sites More sharing options...
mic Posted May 25, 2009 Author Share Posted May 25, 2009 I haven't looked at your references, but that error message is saying that the symbol 'RiSphere' (called by the function coneV(), which is a member of the struct/class 'My_RifPlugin') is unresolved (meaning it can't find it).It's been a while since I've used the Ri library, but I believe RiSphere is defined in ri.h, isn't it? So... you probably just forgot to #include <ri.h> ? thank you, Mario, yes, all RiProcedures are in 'ri.h' file, and this header was included of course - i do nothing with the code: (except #include "stdafx.h") //HelloWorldRiFilter.cpp //This Filter replaces RiCone to RiSphere using the radius parameter #include <RifPlugin.h> #include <ri.h> class My_RifPlugin : public RifPlugin { public: My_RifPlugin(); virtual ~My_RifPlugin(); virtual RifFilter & GetFilter(); private: RifFilter m_rifFilter; static RtVoid coneV (RtFloat height, RtFloat radius, RtFloat tmax,RtInt, RtToken[], RtPointer[]); }; RifPlugin * RifPluginManufacture(int args, char **argv) { return new My_RifPlugin(); } My_RifPlugin::My_RifPlugin() { m_rifFilter.ConeV = coneV; } My_RifPlugin::~My_RifPlugin() { } RifFilter & My_RifPlugin::GetFilter() { return m_rifFilter; } RtVoid My_RifPlugin::coneV(RtFloat height, RtFloat radius, RtFloat tmax, RtInt, RtToken[], RtPointer[]) { RiSphere(radius,-radius,radius,tmax,NULL); } Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 25, 2009 Share Posted May 25, 2009 thank you, Mario, yes, all RiProcedures are in 'ri.h' file, and this header was included of course - i do nothing with the code: (except #include "stdafx.h") I see. Well, I just took another look at the error message, and it does start with 'LNK', which seems to suggest a linking problem. Are you forgetting to link in the Ri library perhaps? Quote Link to comment Share on other sites More sharing options...
mic Posted May 25, 2009 Author Share Posted May 25, 2009 I see. Well, I just took another look at the error message, and it does start with 'LNK', which seems to suggest a linking problem. Are you forgetting to link in the Ri library perhaps? hmm, i use microsoft visual studio 2008 express. i've done: in properties -> c/c++ -> general i added the additional include dirs (path to .h files (ri.h etc)) in Linker -> Input -> Additional Dependencies i wrote the path to prman.lib file after this there are no errors and test.dll is ready. unfortunately i can't check it right now. but the second action i've done intuitively) is this the right way for this tasks or i've done smth wrong?) Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 26, 2009 Share Posted May 26, 2009 is this the right way for this tasks or i've done smth wrong?) Ah. Sorry. I'm more of a Linux-command-line kinda guy. But there must be a way to specify libraries to link against. Probably wherever you specify your "build" or "project" or some similarly named thing. Plus, there might be some additional system-related path tidbits to deal with when using DLLs versus static libs... and/or compiler version/compatibility issues when working with DLLs... There are people in this forum who know the Windows development environment far better than I, so I'll defer to them Good luck! Quote Link to comment Share on other sites More sharing options...
mic Posted May 26, 2009 Author Share Posted May 26, 2009 thank you very much, Mario =) Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted May 26, 2009 Share Posted May 26, 2009 thank you very much, Mario =) Another thing to watch out for is the PRMan SDK changed in version 14. And you have to link against libprman.lib instead of prman.lib in windows now. (But then I'm not sure if this applies for the RiFs). FWIW, if you haven't already tried you might get better mileage on https://renderman.pixar.com/forum/ Quote Link to comment Share on other sites More sharing options...
mic Posted May 26, 2009 Author Share Posted May 26, 2009 Another thing to watch out for is the PRMan SDK changed in version 14. And you have to link against libprman.lib instead of prman.lib in windows now. (But then I'm not sure if this applies for the RiFs). FWIW, if you haven't already tried you might get better mileage on https://renderman.pixar.com/forum/ thanks, but now everything is solved, i think) Quote Link to comment Share on other sites More sharing options...
melazoma Posted January 20, 2010 Share Posted January 20, 2010 Hi mic, Would you mind sharing how you solved this problem? i.e. what additional paths/libs/header file did you add to the Visual Studio project? Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.