Notifications
Clear all

[Closed] SDK Maxscript Extention help

yep, i’ve tried a clean rebuild many many times

I probly should hav mensioned this earlier but i do get a few warnings along with the error, the most significant of which are:
warning LNK4002: “wchar_t const * __cdecl LibDescription(void)” (?LibDescription@@YAPB_WXZ) defined in .\Debug\dllmain.obj intervalarray.def
and
warning LNK4002: “char const * __cdecl LibDescription(void)” (?LibDescription@@YAPBDXZ) defined in C:\Program Files (x86)\Autodesk\3dsMax8\maxsdk\lib\maxscrpt.lib intervalarray.def

do you get any warnings besides ‘unicode’ macro redefinition ? and what can i do about these ?

Hi all! I pretty new to all this to and I’ve been faced with the same problem and I didn’t find a fix to it either…however.

I started using the wizard that comes with max9 (and I think is avaliable some where in forums) and I’ve not had a problem with that since…

I’m not sure if this is an issue, but…

Should the order that the functions appear in class file be the same as the description file??

ie should the description file read…


 LIBRARY IntervalArray
   EXPORTS
 	LibInit			  @1
 	LibDescription   @2
 	LibVersion		@3
   SECTIONS
 	.data READ WRITE
    

instead??

Like I said, I’m completly new to this two, but I was wondering if that had some kind of effect???

Shane

Scratch the last, I don’t think it makes any difference…however, you might want to consider

LIBRARY IntervalArray

Adding the library extension to “IntervalArray”…ie “.dlu”

Again, I have no idea if this makes any difference…throw a warning for me

Shane

Gravey, yes, that would help

 Next time please post a bit more of the build transcript, it gives it context. I realized I wasn't linking against maxscrpt.lib, which is why I didn't see your error. (I wouldn't have known without seeing the full error.)
 
In short, disable unicode. (Project properties->General->Character Set = {Either "Not Set" or "MBCS").

Longer version:

 If you link against it, and build with unicode enabled, you get:

     1>Linking...
     1>interval.def : warning LNK4022: cannot find unique match for symbol 'LibDescription'
     1>interval.def : warning LNK4002: "wchar_t const * __cdecl LibDescription(void)" (?LibDescription@@YAPB_WXZ) defined in .\Debug\dllmain.obj
     1>interval.def : warning LNK4002: "char const * __cdecl LibDescription(void)" (?LibDescription@@YAPBDXZ) defined in D:\maxsdk\lib\maxscrpt.lib
     1>interval.def : error LNK2001: unresolved external symbol LibDescription
     
which tells me that maxscrpt.lib defined LibDescription for ANSI/MBCS strings, but *not* Unicode. As such there is a conflict when you ask to export the undecorated symbol 'LibDescription', it finds two different decorated (mangled) symbols that both match the name given in the module definition file. Hence it can't resolve which to link against.

I *think* that's the problem, but if a win32 expert wants to correct me, please do.

EDIT: The max8 sdk docs confirm that max does not yet support unicode.

EDIT2: Might I suggest a good read on how max 8 supports (or doesn’t) various character sets, and how you should use them, can be found in the manual under 3ds max programmer’s guide=>programming 3ds max features=>Managing the user interface=>Character strings.

It’s good that they’re planning for the future by using generic character/string types.

Way cool! That would explain A LOT!!

Thanks!

Shane

yea sorry that I didn’t mension the warnings earlier, I’m not usually one to leave out details in my posts.

Thanks for all the info, unfortunatly i’ve been trying to reinstall windows today on my comp which has vs2005 on it and run into some issues so i’m unable to test it. Your explanation does seem logical though and at the very least i’ll be able to test it at work on monday.

Thanks for the help, and thanks for pointin me in the direction of some relevent reading in the docs. I’ll be sure to check that out

No worries, let us know how it went.

I have to apologize about the typos in the tutorial document. Originally it got spell checked quite a few times, but as it passed from Microsoft Word to HTML, things happend. I’ve been wanting to go back and do a few polishes here and there for a long time, but the problem was, the source code for the documentation was not accessible to me (or any other programmer for that matter). That, btw, was just rectified only fairly recently.

BTW:

The source code for that sample plugin is included with the SDK.

It should be at (going by memory here):
<sdk>\howto\maxscript\intervalarray

Chris Johnson

Thanks again for the help. I’m no longer getting any errors and it works in max however i’m still getting a warning about bitmap.h

warning C4996: ‘strcpy’: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. bitmap.h

any ideas ?

If I’m not wrong, this is an buffer overrun update. I don’t think it should effect us.

ed: Correction, it does effect us, but we can get away with it

Shane

Page 2 / 3