PDA

View Full Version : Compiling my shader on Vista x64



AndersNyman
May 17th, 2009, 21:33
Hi!
My first post here so be nice to me ;)

I´m a artist that do some shader programming when its necissary. (mostly for renderman)

Now I having problems getting visual studio running with my mentelray shaders. Im using Vista 64bit.

This is the steps I have done so far (with no luck):
1. Installed Visual Studio C++ 2008 Express
2. Installed Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5
3. In project properties I have set:
Additional Include Directories:
"C:\Program Files\Microsoft SDKs\Windows\v6.1\Include";"C:\Program Files\Autodesk\Maya2009\devkit\mentalray\include"
Additional Library Directories:
"C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib";"C:\Program Files\Autodesk\Maya2009\devkit\mentalray\lib\nt"
Additional Dependencies:
shader.lib


This is the output I get while building:

1>------ Build started: Project: myMRShader, Configuration: Release Win32 ------
1>Linking...
1> Creating library C:\Users\Anders Nyman\Documents\Visual Studio 2008\mr_shaders\myMRShader\Release\myMRShader.lib and object C:\Users\Anders Nyman\Documents\Visual Studio 2008\mr_shaders\myMRShader\Release\myMRShader.exp
1>myMRShader.obj : error LNK2001: unresolved external symbol _mi_phen_eval
1>myMRShader.obj : error LNK2001: unresolved external symbol _mi_trace_light
1>C:\Users\Anders Nyman\Documents\Visual Studio 2008\mr_shaders\myMRShader\Release\myMRShader.dll : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\Anders Nyman\Documents\Visual Studio 2008\mr_shaders\myMRShader\myMRShader\Release\Buil dLog.htm"
1>myMRShader - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

bart
May 18th, 2009, 20:32
Try smaller, simple steps at first.

One of the advantages of having standalone, is that you can take smaller steps to debug your compiling and testing iteration.

Rather than try the 2008 Express UI, project set up and the loading of Maya dev and everything ...

Just try compiling the book's one_color shader from the command line as layed out on the website that supports the book: www.writingshaders.com

irendeir
May 19th, 2009, 11:21
I think, you must make you project x64 in Visual Studio. Project->Properties in left coner you can see button - Configuration Manager. In table click - Acitve Solution Platform and New, use x64.

And try compile again :)

mhurlbut
November 12th, 2012, 05:31
I was having the same problem for the longest time. Turns out Visual Studio Express doesn't come with the 64 bit compiler. Once I downloaded the professional version and compiled, I got my shader to work. Thanks, irendeir! The link (www.writingshaders.com) from above was also helpful.

I assume you've fixed your issue, but for those who are stuck in the same place, make sure you're compiling with the 64 bit compiler if you're running a 64 bit machine. You should be able to download it online.

bart
November 16th, 2012, 18:58
That is for 2008 Express, as I've successfully used in the past, when also downloading the Windows SDK in the proper order.

But for more modern 2010 and above, 64-bit compiles may be more challenging, and require you to purchase the full Visual Studio. It may be possible to download the proper software for 64-bit compiles in some environments, but in mine, I ran into some sort of loading order issue. Tried all the potential solutions found on the net, but to no avail.