Message 1 of 2
Custom Shaders - Compiling with Visual Studio C++ 10.0?

Not applicable
10-24-2012
06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm new to custom shading and I'm getting stuck in the compiling stage.
I'm using the Visual Studio compiler on Vista x64. I'm trying to compile a mental ray shader from this site http://www.writingshaders.com/ using the provided instructions. The shader simply takes in a color and sets it to the result pointer.
The error (shown below) comes in the linking stage where I try to make my .dll file. _mi_phen_eval is a function declared in shader.h that is used by mi_eval_color, which I call once in this shader. The error says there is an unresolved external symbol _mi_phen_eval referenced in the shader function, but I don't see how this could happen if I include shader.h and link to shader.lib as specified in mental ray documentation.
Has anyone else run into this problem?
Thanks!
I'm new to custom shading and I'm getting stuck in the compiling stage.
I'm using the Visual Studio compiler on Vista x64. I'm trying to compile a mental ray shader from this site http://www.writingshaders.com/ using the provided instructions. The shader simply takes in a color and sets it to the result pointer.
The error (shown below) comes in the linking stage where I try to make my .dll file. _mi_phen_eval is a function declared in shader.h that is used by mi_eval_color, which I call once in this shader. The error says there is an unresolved external symbol _mi_phen_eval referenced in the shader function, but I don't see how this could happen if I include shader.h and link to shader.lib as specified in mental ray documentation.
C:\Program Files\Autodesk\Maya2013\mentalray\devkit>cl /c /O2 /MD /no
logo /W3 -DWIN_NT -D64 /I"C:\Program Files\Autodesk\Maya2013\mentalray\devkit\in
clude" one_color.c
one_color.c
C:\Program Files\Autodesk\Maya2013\mentalray\devkit>link /nologo /nod
efaultlib:LIBC.LIB /OPT:NOREF /INCREMENTAL:NO /DLL /OUT:one_color.dll one_color.
obj shader.lib
Creating library one_color.lib and object one_color.exp
one_color.obj : error LNK2019: unresolved external symbol _mi_phen_eval referenc
ed in function _one_color
one_color.dll : fatal error LNK1120: 1 unresolved externals
Has anyone else run into this problem?
Thanks!