Jump to content
Sign in to follow this  
mic

RiFilters

Recommended Posts

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?..)

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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 &lt;RifPlugin.h&gt;
#include &lt;ri.h&gt;

class My_RifPlugin : public RifPlugin
{
public:
			My_RifPlugin();
virtual 		~My_RifPlugin();

virtual RifFilter &amp; 	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 &amp; 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);
}

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?)

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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/

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×