Skip to main content
gamedev.net
🔒 Locked

DLL Problems

Started by Drezard Jan 4, 2007 at 10:24 PM 0 replies 450+ views
Original Post
Drezard
Drezard
Hello here is the code for my DLL: CODE: extern "C" _declspec(dllexport)int BoxVolume(int L, int H, int W); BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; } int BoxVolume2 (int L, int H, int W) { return (L * H) * W; } Im using Dev-C++ to compile it and im trying to compile it as a static DLL. Im not sure what im doing wrong but here are the errors: Line 1: Expected Constructor, Destructor, or type conversion "(" token. Line 1: Expected ',' or ';' before '(' token Line 3: 'BOOL'does not have name What am i doing wrong? - Cheers, Daniel
dagbud
dagbud
At first glance it looks like you need another _ before _declspec making it __declspec. And make sure you are including windows.h for the BOOL declaration. Also you really don't need a DllMain function if you aren't using it as it is an optional entry point. Hope that helps a little.

Edmund Weese7-bit Games

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.