[SDL] Attempting to make SDL wrapper for QB64 - First hurdle!

Alex Barry alex.barry at gmail.com
Mon Dec 6 17:04:07 PST 2010


Try compiling without the SDL_LINK_API macro.  It will almost certainly get
rid of the errors, but it may not link properly.  Just out of curiosity, are
you actually compiling a dynamic library, or just a module?

On Mon, Dec 6, 2010 at 5:10 PM, Unseen Machine <jmonyon at yahoo.co.uk> wrote:

>  But i have just managed to create new errors! LOL!!
>
> QB64 really has moved on, i have made a 2d game engine in it, thats why i
> after the joystick first!
>
> Here is my header file and .cpp file
>
> the new errors are the same as each other, the braces seemd to solve the
> other problem,
>
> 1>SDL_Link.obj : error LNK2019: unresolved external symbol
> _SDL_NumJoysticks referenced in function _SDL_Link_NumJoys
>
>
>
> Code:
>
>
> #ifdef SDL_LINK_EXPORTS
> #define SDL_LINK_API __declspec(dllexport)
> #else
> #define SDL_LINK_API __declspec(dllimport)
> #endif
>
> // This class is exported from the SDL_Link.dll
> class SDL_LINK_API CSDL_Link {
> public:
>    CSDL_Link(void);
>    // TODO: add your methods here.
> };
>
> extern "C" SDL_LINK_API int SDL_Link_NumJoys(void);
>
>
> SDL_LINK_API int fnSDL_Link(void);
>
>
>
>
>
>
>
>
> Code:
>
>
> // SDL_Link.cpp : Defines the exported functions for the DLL application.
> //
>
> #include "stdafx.h"
> #include "SDL_Link.h"
> #include "SDL.h"
>
>
> SDL_LINK_API int SDL_Link_NumJoys(void)
> {
>    if(SDL_WasInit(SDL_INIT_JOYSTICK)== -1)
>    {
>       return -1;
>    }
>    else
>    {
>       return SDL_NumJoysticks();
>
>    }
> }
>
>
>
> // This is the constructor of a class that has been exported.
> // see SDL_Link.h for the class definition
> CSDL_Link::CSDL_Link()
> {
>    return;
> }
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101206/e8875b7e/attachment-0008.htm>


More information about the SDL mailing list