How to add cpp file to SDL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to add cpp file to SDL

ancientcc-3

I want to add video capture to SDL 2.0.5. On Windows, it is based on DirectShow, and DirectShow require to use a lot of class, for example IFilter, IPin. But when I add them to SDL, compile successfully, link fail.

 

Below is some error information.

 

1>vtrans.obj : error LNK2001: unresolved external symbol __purecall

1>winctrl.obj : error LNK2001: unresolved external symbol __purecall

1>transip.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)

1>winutil.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)

1>transip.obj : error LNK2001: unresolved external symbol _memcpy

 

How to resolve it?


_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add cpp file to SDL

Ryan C. Gordon

> How to resolve it?

You probably need to link against Microsoft's C++ runtime. SDL's Visual
Studio project files don't link against _any_ C or C++ runtime at all
(we implement our own malloc() using Win32 calls directly, etc). This is
not my area of expertise, but it's probably just a simple change in the
project files to fix this (but if you're planning on submitting this as
a patch for SDL, we can't take in a C++ dependency).

Alternately: I presume DirectShow is a COM interface; you can call these
from C with some magic macros. Here's an example of calling some
IDirectSound methods, to see this sort of thing in action:

https://hg.libsdl.org/SDL/file/18f1e8b0737d/src/audio/directsound/SDL_directsound.c#l210

--ryan.


_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add cpp file to SDL

ancientcc-3
With my ability, I have to give up adding cpp file temporarily.

Very much hope that SDL can support capture video!

-----Original Message-----
From: SDL [mailto:[hidden email]] On Behalf Of Ryan C. Gordon
Sent: Sunday, November 27, 2016 2:39 PM
To: SDL Development List <[hidden email]>
Subject: Re: [SDL] How to add cpp file to SDL


> How to resolve it?

You probably need to link against Microsoft's C++ runtime. SDL's Visual
Studio project files don't link against _any_ C or C++ runtime at all (we
implement our own malloc() using Win32 calls directly, etc). This is not my
area of expertise, but it's probably just a simple change in the project
files to fix this (but if you're planning on submitting this as a patch for
SDL, we can't take in a C++ dependency).

Alternately: I presume DirectShow is a COM interface; you can call these
from C with some magic macros. Here's an example of calling some
IDirectSound methods, to see this sort of thing in action:

https://hg.libsdl.org/SDL/file/18f1e8b0737d/src/audio/directsound/SDL_direct
sound.c#l210

--ryan.


_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Loading...