Linking Renderman's api to visual C++ or Dev-C++


#1

Hi, I’ve tried the appendex C in the documentation for renderman, and looked through renderman companion but I still don’t know how to link my renderman’s api to either my VC++ or Dev’s C++. Is it possible? I’ve only seen people online linking the BMRT to VC ++.
i’ve had this problem…for a whole week, and I can’t start learning my renderman because I can’t compile the first program that’s in the renderman companion …

Plz point me to a direction, Thx u


#2

For the C API, don’t you have to link against the prman executable?

I could never get this to work properly either… Try the forums at www.pixar.com


#3

Are you talking about the listing in
‘The Renderman Companion - A Programmer’s Guide to Realistic Renderman’
page 18 listing 2.1 and the subsequent once?


#4

i have a similar problem i wrote this program

/* min.c - a minimal C file */

#include <ri.h>

int main(int argc, char *argv[])
{
RiBegin(RI_NULL);
RiDisplay (“min.tiff”, “framebuffer”, “rgb”, RI_NULL);
RiProjection (“perspective”, RI_NULL);
RiWorldBegin();
RiTranslate(0,0,2);
RiSphere(1,-1,1,360,RI_NULL);
RiWorldEnd();
RiEnd();
return 0;
}

from a book (Essential renderman fast), but when i try to compile it i get lots of linker errors:

min.obj : error LNK2001: unresolved external symbol _RiEnd
min.obj : error LNK2001: unresolved external symbol _RiWorldEnd
min.obj : error LNK2001: unresolved external symbol _RiSphere
min.obj : error LNK2001: unresolved external symbol _RiTranslate
min.obj : error LNK2001: unresolved external symbol _RiWorldBegin
min.obj : error LNK2001: unresolved external symbol _RiProjection
min.obj : error LNK2001: unresolved external symbol _RiDisplay
min.obj : error LNK2001: unresolved external symbol _RiBegin
Debug/min.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.

So how do i get rid of those? and what do i do with the .exe file once its compiled?

AnDy


#5

Originally posted by westiemad
[B]…when i try to compile it i get lots of linker errors:

min.obj : error LNK2001: unresolved external symbol _RiEnd
min.obj : error LNK2001: unresolved external symbol _RiWorldEnd
min.obj : error LNK2001: unresolved external symbol _RiSphere
min.obj : error LNK2001: unresolved external symbol _RiTranslate
min.obj : error LNK2001: unresolved external symbol _RiWorldBegin
min.obj : error LNK2001: unresolved external symbol _RiProjection
min.obj : error LNK2001: unresolved external symbol _RiDisplay
min.obj : error LNK2001: unresolved external symbol _RiBegin
Debug/min.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.

So how do i get rid of those? and what do i do with the .exe file once its compiled?

AnDy [/B]

never worked with the renderman api, so dunno what this does (and what the exe does) … but are you sure your compiler is pointed correctly to where it is able to find the included “ri.h”? … looks like a common linkage prob - so that the compiler arguments/flags are not set correclty …


#6

ri.h is actually called by its location on the drive, "C:\Program files… etc

Thats the only code in the book.

EDIT: it will build a cpp file, but it won’t fully compile.

AnDy


#7

as schmu_20mol pointed out your compiler flags aren’t set correctly.
Also keep in mind that you have to use the same compiler with which the library has been compiled.

andre


#8

oh well, i’ll come back to it, i’m learning to write shaders at the moment, and it isn’t used :).

AnDy


#9

if you´re only using the renderman api directly, download cgkit for python here
cgkit.sf.net
the ri module is the complete renderman api, 3.2 or something

unless you´re coding an application, there is no reason to prefer C over python. Once you run the python script, it´ll spit out a rib file, just as the C application would. it´ll even pipe it into your fav renderer if you want it to

jens.


#10

Hi,

dont know the intracies of the library in question, but those linker errors are typically due to the fact that the linker knows about the function prototypes (i.e. .h file is there) but cannot find the object code i.e. .cpp file or for prop’ code *.lib files and dll or obj libs.

JA


#11

Whichever renderer you’re using should’ve come with a .lib file. Make sure this file gets linked with your source code.


#12

absolutely right. renderman api for C/python is only for rib generation and if u cant seem to fix the linking error and whatnot, follow the link posted above and start using python for procedural rib generation. its been a while since i last created ribs from C/Python code but I think u need to replace RI_NULL by “filename”. As a result, a rib named filename.rib will be created in the debug/release/etc. folder.


#13

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.