Notifications
Clear all

[Closed] Building an x64 plugin in Visual Studio

Hi,

I have the max9 source code for a plugin (lscmunwrap) that I’m trying to build for x64 and am really lost – I tried to compile one of the sample plugins (melt) from the SDK under win32 as a test, but am not getting the .dlm to output no matter what I do! Is there any step by step guide for dummies (like me) for building in visual studio pro 2005? Any help would be sincerely appreciated!

Thanks!

(ps. do you have to assign env variables for the max location and SDK location? The only two errors I got were related to $(3dsmax) and $(maxsdk) not being assigned – I dont think this format $(maxsdk) is proper format for a windows variable – should it be $maxsdk=c:<path>?)

EDIT:

OK, I think I’m almost there – I get one error:

—— Build started: Project: lscm_unwrap, Configuration: OUTPUT x64 ——
Compiling…
lscm_backend.cpp
.\lscm_backend.cpp(1167) : error C2065: ‘i’ : undeclared identifier

Any ideas?

6 Replies

Maybe this will help.
In my case all I had to do was to create new soulution with platform set to x64 and set “Additionad Library Directories” to <maxsdk root>\x64\lib.
Did You remember to install x64 stuff when installing VS2005? It isn’t checked by default.

I’m totally convinced I’m 99% there – I’m going to try to build the win32 and see if it’s the same error – if so, then I’ll be convinced there’s something wrong in the source code and will ask the devoper for help – here’s the link if you feel like giving it a whirl! It’s a pretty cool plug!!

http://www.scriptspot.com/scripts/web_upload/Christoph%20Kubisch/lscmunwrap.zip

EDIT: same deal – the source was done in VS2003 and I definitely think there is an issue with an undeclared variable ‘i’ that VS2005 will not tolerate – more digging

Go to line 1167 in lscm_backend.cpp and change:

for (i=0; i< tmap->FNum(); i++,tf++)

to:

for (int i=0; i< tmap->FNum(); i++,tf++)

Nevermind – I’m fustrated and over my head and too damn old to learn – going to drink now, if some kind sould could compile this f-ing thing for x64 it’s be appreciated.

(ps. here’s why:

—— Build started: Project: lscm_unwrap, Configuration: x64 dammit x64 ——
Compiling…
lscm_unwrap.cpp
DllEntry.cpp
Generating Code…
Linking…
Creating library .\lscm_unwrap___Win32_Hybrid/lscm_unwrap.lib and object .\lscm_unwrap___Win32_Hybrid/lscm_unwrap.exp
lscm_unwrap.exp : warning LNK4070: /OUT:LSCMUnwrap.dll directive in .EXP differs from output filename ‘.\LSCMUnwrap_9-32.gup’; ignoring directive
lscm_backend.obj : error LNK2019: unresolved external symbol nlDeleteContext referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlGetCurrent referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlSolve referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlEnd referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlLockVariable referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlBegin referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlSolverParameteri referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlNewContext referenced in function “int __cdecl unwrap_lscm_face_group(class MNMesh *,int *,int)” (?unwrap_lscm_face_group@@YAHPEAVMNMesh@@PEAHH@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlSetVariable referenced in function “void __cdecl lscm_set_initial_solution(class MNMesh *,struct LscmVert * *,int,class Point3 &,class Point3 &,int *,int *)” (?lscm_set_initial_solution@@YAXPEAVMNMesh@@PEAPEAULscmVert@@HAEAVPoint3@@2PEAH3@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlCoefficient referenced in function “void __cdecl lscm_add_triangle(class Point3 &,class Point3 &,class Point3 &,int,int,int,class Point3 &,float)” (?lscm_add_triangle@@YAXAEAVPoint3@@00HHH0M@Z)
lscm_backend.obj : error LNK2019: unresolved external symbol nlGetVariable referenced in function “void __cdecl lscm_load_solution(class MNMesh *,struct LscmVert *,int *,int)” (?lscm_load_solution@@YAXPEAVMNMesh@@PEAULscmVert@@PEAHH@Z)
.\LSCMUnwrap_9-32.gup : fatal error LNK1120: 11 unresolved externals
Build log was saved at “file://c:\Documents and Settings\Jeff\Desktop\lscm_unwrap_source\x64\x64 dammit\BuildLog.htm”
lscm_unwrap – 12 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The errors you have is because you need to link with the correct (x64) version of OpenNL library

Download the blender source files
http://download.blender.org/source/blender-2.42a.tar.gz

  • open (convert) the project in
  • blender-2.42a\intern\opennl\make\msvc_7_0
  • build the library (libopennl.lib)
  • add it to the libraries in LCSM project properties (linker)

(cannot do it myself because i don’t have x64)
attached is the Win32 debug VC8 version of the OpenNL library (to compile the Max9 Win32 version)

Good luck

Hence the unresolved links in the errors I posted! Hey, I sincerely appreciate the help – I’ll give it another go, every step in this I’m learning something!! Thanks!!

EDIT: I did everything correctly with no errors, the plugin loads, but does not function correctly (ie. LSCM unwrap results in a totally white UV edit screen…)

I’m stuck.