imageworks / Field3D

[NO LONGER MAINTAINED] A library for storing voxel data on disk and in memory.
https://github.com/imageworks/Field3D/wiki/Field3D-Home
BSD 3-Clause "New" or "Revised" License
305 stars 72 forks source link

windows support : dynamic loading on windows #18

Open caron opened 13 years ago

caron commented 13 years ago

..\src\PluginLoader.cpp(44): fatal error C1083: Cannot open include file: 'dlfcn.h': No such file or directory

dlfcn.h isn't on windows, instead we should include windows.h and use windows calls instead. i have read they are as follows...

dlopen --> HMODULE LoadLibrary(char path) dlsym --> void GetProcAddress(HMODULE lib, char *sym) dlclose --> void FreeLibrary(HMODULE lib)

the prepocessor conditions are going to get ugly, maybe field3d specific dynamic library functions which direct the right code per environment?

caron commented 13 years ago

i was looking into this and was wondering if an example plugin for field3d could be included? this way plugin loading code could be unit tested for both platforms.

caron commented 13 years ago

so, i am evaluating Boost.Extensions...

http://boost-extension.redshoelace.com/docs/boost/extension/boost_extension/tutorials.html

and this example code...

http://www.codeproject.com/KB/DLL/BCLoadLib.aspx