View Full Version : Compilation errors?

10-11-2004, 09:30 AM
Hi all.

I'm just starting out with the Lightwave SDK and have followed the instructions to create the static library and wanted to set off by test compiling one of the easyest samples I could find on the net (http://www.newtek.com/products/lightwave/developer/8lwsdk/docs/articles/box1.html)

First off I followed the instructions on startnig a new plugin (include this file, that file, set the additional paths etc. etc.) and got errors in the includes (they were defaulting to lwsdk/xxx.h) which I fixed.

Next thing I know it's failing on the ServerRecord assignment.

The error message is:
error C2440: 'initializing' : cannot convert from '' to 'int (__cdecl *)(long,void *(__cdecl *)(const char *,int),void *,void *)

for the line that reads:
{ LWMODCOMMAND_CLASS, "Tutorial_Box1", Activate },

I have the distinct feeling that I'm missing a setting - even though I've already checked all the options and gone through the compile instructions twice.

Anyone know how to fix this?

thanks :confused:

10-11-2004, 05:49 PM
Go into your project settings and change the "Compile As" setting to compile the project as C code instead of C++ code. That should fix your errors.

10-12-2004, 08:58 AM
Thanks Spook

That did it.

I couldn't find anywhere in the project setting that would override the compilation from C++ to C, however once I renamed the file to .c and re-added it to the project it compiled fine (just had to add a little /nodefaultlib:xyz statement.