Subj : Link DLL using BCC32 free compiler To : borland.public.cpp.borlandcpp From : Doug Martin Date : Wed Aug 04 2004 02:32 am How is a DLL linked to an application using the free command line compiler, BCC32 (version 5.5)? Both are written in ANSI C. For example, if MyDLL.c is: __declspec(dllexport) int __stdcall DLLFunction1(int num) { return(2*num); } It is compiled to a DLL at the command line using: > bcc32 -WD MyDLL.c to generate MyDLL.dll, MyDLL.obj. and MyDLL.tds. Then the lib file is generated using: > implib MyDLL.lib MyDLL.dll Both MyDLL.lib MyDLL.dll are added to the project directory. If the application, named test_MyDLL.c is: __declspec(dllimport) void __stdcall DLLFunction1(int num); int main(void){ int ret_val=DLLFunction1(6); return 0; } the compiler error is: Error E2468 test_MyDLL.c 3: Value of type void is not allowed in function main .