Startide 3D Using BMRT with Visual C++ 4.0
Science Fiction
Brin-L
David Brin Fan Fiction
Scans
Links
Babylon 5
Star Trek
Isaac Asimov
Spacer Worlds
Art and 3D Graphics
Online Store
Chmeee's 3D Objects
3D Gallery
Drawings
Blueprints
Links
Computers
Software
BMRT & VC++
Desktop
Animated GIFs
Linux
Web Design
Software Links
Other
About Me
Million Dollar Band
Misc
Space
Science

History

I've wasted a lot of time I could have used making BMRT images, just trying to figure out how to make Visual C++ 4.0 work with the libraries. When I had trouble with it, I asked Michael B. Johnson, who did the Windows port, what the problem might be. He told me that he built the libraries for VC++5.0, and 4.0 may not even be able to use them. I put the problem on the back shelf after that, until I thought to ask the DJGPP newsgroup. Gerhard Gruber told me that you can use the libraries in 4.0. After that, I quickly figured out how to use the BMRT libraries. Thanks, guys!

Enough talk -- How Do You Do It?

Bear in mind, that I'm not going to teach you how to WRITE a program. A good place for learning about that is The Renderman Companion, by Steve Upstill. These instructions will just let you use the annoyingly complicated Visual C++.

  1. Put the BMRT include file and libraries in the right places: copy ri.h into the C:\MSDevStd\include directory, and copy libribout.lib and libslcargs.lib to C:\MSDevStd\lib
  2. Start up VC++ 4.0
  3. Go to File | New... and choose a New Project Workspace. Make it a console application (that is, a DOS command-prompt-type program), so you don't have to worry about the complicated Windows MFC stuff. Then, type a name for your project, like "RiTest" (don't include the quotes!), and hit enter. You now have a new VC++ project.
  4. Go to File | New... again, and create a new text file. Save it as RiTest.c, or any other name, but I prefer to give the C file the same name as the project. Write a C program to generate RIB files (or if you already have one written, move it to the c:\RiTest directory, and rename it RiTest.c.)
  5. You need to add the C program to the project. Go to Insert | Files into Project, and choose the C program you just wrote.
  6. Now, go to Build | Settings. This is what the settings window looks like:

    [VC++ Settings Window]


    Look for the tab marked "Link". If you don't see it, use the little buttons with arrows on them to move the tabs over, until you find the "Link" tab. Click the "Link" tab. Now that you're in the Link window, add libribout.lib and libslcargs.lib to the Object/Library Modules text box, as shown:

    [Where to add the libraries]


    Now this part is the big secret, the part I just figured out -- you need to find some way of keeping the compiler from linking the libc library. For some reason, the BMRT libraries seem to clash with libc. To keep the pesky libc out of your executables, click the "C/C++" tab, and enter ', "/Zl libc.lib"'. Make sure that's Zl, as in lamb.

    [How to get rid of libc]


  7. Now, you're ready to build your program! Just click Build | Build RiTest.cpp. The executable will appear in the C:\RiTest\Debug directory.

Head home to the Index Last modified:
August 16, 1998
E-mail me: