Jump to content

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

Link to comment
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).

Link to comment
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);
}

Link to comment
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?

Link to comment
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?)

Link to comment
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!

Link to comment
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/

Link to comment
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)

Link to comment
Share on other sites

  • 7 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...