OpenSubdiv icon indicating copy to clipboard operation
OpenSubdiv copied to clipboard

Support dynamic linking on Windows

Open andrewkww opened this issue 13 years ago • 4 comments
trafficstars

This is a continuation of #27 for Windows.

My code so far is available on my windows branch here.

The idea is to have a define (i.e. OSD_API) to switch bewteen

__declspec(dllexport)

and

__declspec(dllimport)

Also, if we want the headers to work with dynamic link by default, it's better to flip all the conditions from OSD_DLL to something like OSD_STATIC. This way, the header file will be ready to use for dynamic linking by default. And if the client wants to do static link, the client will have to define OSD_STATIC instead.

After defining OSD_API, we just need to mark classes/methods that we want to expose through the DLL. I've done so with all the dispatchers. So currently, the glutViewer should link and run with dynamic OSD.

I haven't gotten to the ptex classes yet. So the ptexViewer doesn't link right now. I'll try to get to that next.

andrewkww avatar Sep 12 '12 04:09 andrewkww

I've updated the windows branch to include the patch for export ptex classes as well. The ptexViewer will now link dynamically with OSD.

andrewkww avatar Sep 15 '12 16:09 andrewkww

I have revived my commits for supporting dynamic linking on Windows. They're more or less the same as before, except updated to the latest OSD code. The commits are still WIP, and some things need to be sorted out. But for now, I've pushed the new commits to my windows_dll branch for those interested.

andrewkww avatar Feb 13 '13 02:02 andrewkww

Filed as internal issue #151683.

jtran56 avatar Sep 30 '17 01:09 jtran56