
Visual C++ Makefiles for LightWave plug-ins

Here's what I did to create VC 2.0 projects for making LightWave and
Modeler plug-ins.

I made a directory "LW" at the root of my I: drive, and under it, and
made WIN, SGI, AMIGA directories.  All the LWSDK.ZIP is 'pkunzip -d'
under \LW\WIN.

For the libraries, I created new projects (*.MAK) for server.mak and
serv_w.mak in LW\WIN\LIB.  These reference the proper source files in
LW\WIN\SOURCE.

Under Project Settings / C/C++ / General, I added preprocessor
definitions for  _X86_ and _WIN32.

Under Project Settings / C/C++ / Preprocessor, I added '..\include'
as an Additional Include Directory.

For the SAMPLES, I made subdirectories under LW\WIN\SAMPLE for each,
with the same name as the module source file. 

For these SAMPLE projects, they get the Additional Include directory
of '..\..\include', and the preprocessor definitions mentioned above.

In Project Settings / Link / General, I added 
..\..\lib\WinDebug\serv_w.obj ..\..\lib\WinDebug\server.lib to
Object/Library Modules, with separate definitions for WinRel
accordingly, which easily allows Targets for both debugging and
release.

These path names are relative, and should work regardless of your
drive letter, but the files within the Project group itself are not
relative, but VC should recognize that the project has been moved,
and will adjust it automatically.

Project Files / Files in Group includes LW\WIN\INCLUDE\SERV.DEF as
well as the project's main source file.

I changed the Output File Name to the same ".p" style used in the 
examples.

The resulting plug-in is created in WinDebug or WinRel accordingly,
of course, under the sub-directory for the sample.  You will need to
copy this file to the LW directory and/or change the reference to it
in your LWM.CFG file:

Plugin ObjectLoader Demo_3DG1 J:\vsformat\windebug\vsformat.p VS geo Obj

where I SUBST'd a J: drive to the LW\WIN\SAMPLE directory, in order
to shorten the path length for LWM.CFG.

Or, when cd'd to LW\WIN\SAMPLE, you can use the GETP.BAT batch file to
copy all the sample plug-ins (either WinRel or WinDebug) to the
LightWave directory on your machine.


DLL Debugging

The VSFORMAT.MAK file is configured for DLL debugging, although it
points to the Modeler executable on my machine.  You'll need to
customize the paths under Project Settings / Debug for your own
system.  

This makes it very easy to debug DLLs that run under the control of
an executable you didn't create yourself, such as Modeler or
LightWave.  You can set a breakpoint, press F5 to Debug, then Modeler
will start and when you invoke your plug-in, execution will stop on
your breakpoint.


Summary

First, re-make the libraries in WIN\LIB.  There are two *.MAK files.
Then re-make all the projects in the SAMPLES\* subdirectories.

John Foust
Syndesis Corporation
235 South Main Street
Jefferson, WI 53549
(414) 674-5200
(414) 674-6363 FAX

