QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: SpriggsySpriggs on September 29, 2020, 08:00:58 pm
-
I'm trying to write a program in QB64 that captures from the webcam and I've found many programs online showing how to do it and they all have one thing in common: using vfw.h
However, when I try to use it, I get this IDE error:
C++ Compilation failed (Check .\internal\temp\compilelog.txt)
I checked the file and this is what it showed:
In file included from C:/Users/Zachary/Desktop/QB64 x64/internal/c/c_compiler/x86_64-w64-mingw32/include/crtdefs.h:10,
from C:/Users/Zachary/Desktop/QB64 x64/internal/c/c_compiler/x86_64-w64-mingw32/include/inttypes.h:11,
from parts/core/glew/include/GL/glew.h:294,
from parts/core/src.c:2,
from common.h:35,
from qbx.cpp:1:
os.h:54:23: error: declaration does not declare anything [-fpermissive]
#define int64 __int64
^~~~~~~
compilation terminated due to -Wfatal-errors.
-
What's the purpose of including this header file? What definitions are you using from it? You're likely going to have to rewrite them in QB anyway.
-
@luke
I'm trying to make a QB64 version of something like this:
https://www.dreamincode.net/forums/topic/193519-win32-webcam-program/ (https://www.dreamincode.net/forums/topic/193519-win32-webcam-program/)
-
For each function you want to call you need to add it to a DECLARE (CUSTOMTYPE|DYNAMIC) LIBRARY block. You then link with vfw32 directly, no need for a header file.
I'm not savvy enough on details of Windows linking to know whether you should be linking with the vfw32.a static library that comes with mingw or if there's a system-wide dll to use.
However it may all be a moot point because from a casual glance at the linked article it appears the whole shebang is partially driven by handling window events, which you can't really do in QB64.
-
Ok. Hopefully I can make it work. It's an experiment. I has able to generate the window that would hold the webcam feed but that's as far as I've gotten. I'll keep plugging away and see what I get.