hi
i have created .dll and .o file of my huffman class like this :
g++ -c huffman.cpp
g++ -shared -o huffman.dll huffman.o
and i have also huffman.h proto file.
now i want to know is there any way to use these files in vc++2008 whithout loadlibrary and getprocaddress function?
or i need .lib file? if yes how can i create it?
Just link the .lib and make sure the .dll is within the same directory as the executable. From there, include the header(s) pertaining to the DLL and call any functions from the header; your linker will look in your library for the function's definition.
Note that if your compiler is set to compile for multiple platforms, you'll get multiple extensions.
I've been creating DLLs for a while, and I never:
1) ...used dllexport/dllimport
2) ...used WIndows' API to link a DLL
It seems as though you've created a CLI/C++ project, not a C++ one. You need to change that. Also, if you've chose a DLL project, and not a shard library project, you'll have to export the functions with __declspec(dllexport) (this should reside between the function return type-specifier and the identifier (same with the class/struct)).