[newbie] building hdhomerun_config.exe on Windows 10

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
Post Reply
orbot
Posts: 9
Joined: Wed Mar 03, 2021 11:30 am
Device ID: 1067A183 1067A7DF 106C807A 1067B6F8 1080F019

[newbie] building hdhomerun_config.exe on Windows 10

Post by orbot »

Does anyone have any tips for building hdhomerun_config on Windows 10 in Visual Studio Community 2019 or another program? It's failing to build for me in VS2019. I'm just a beginner and am assuming I'm doing something wrong, I'm not even sure if I'm setting up the project properly, but the instructions on the wiki page are very straightforward https://info.hdhomerun.com/info/hdhomerun_config. I have the "Desktop development with C++" Workload installed for VS2019, I open VS2019 and click "Create new project", then "Empty Project", then add all the .c and .h files, then do the project settings stuff with Compile As and adding Additional Dependencies, but I get these errors when trying to build:

Code: Select all

Build started...
1>------ Build started: Project: hdhr3, Configuration: Release Win32 ------
1>hdhomerun_channels.c
1>hdhomerun_channelscan.c
1>hdhomerun_config.c
1>hdhomerun_control.c
1>hdhomerun_debug.c
1>hdhomerun_device.c
1>hdhomerun_device_selector.c
1>hdhomerun_discover.c
1>hdhomerun_os_posix.c
1>\libhdhomerun-master\hdhomerun_os_posix.c(58,16): error C2065: 'CLOCK_MONOTONIC': undeclared identifier
1>\libhdhomerun-master\hdhomerun_os_posix.c(58,2): error C3861: 'clock_gettime': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(63,16): error C2065: 'CLOCK_REALTIME': undeclared identifier
1>\libhdhomerun-master\hdhomerun_os_posix.c(63,2): error C3861: 'clock_gettime': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(68,41): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\libhdhomerun-master\hdhomerun_os_posix.c(68,23): error C2146: syntax error: missing ';' before identifier 'random_get32_once'
1>\libhdhomerun-master\hdhomerun_os_posix.c(68,43): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\libhdhomerun-master\hdhomerun_os_posix.c(68,43): error C2065: 'PTHREAD_ONCE_INIT': undeclared identifier
1>\libhdhomerun-master\hdhomerun_os_posix.c(78,2): error C3861: 'pthread_once': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(103,3): error C3861: 'sleep': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(109,11): error C2065: 'useconds_t': undeclared identifier
1>\libhdhomerun-master\hdhomerun_os_posix.c(109,22): error C2146: syntax error: missing ')' before identifier 'delay_us'
1>\libhdhomerun-master\hdhomerun_os_posix.c(109,3): error C3861: 'usleep': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(109,22): error C2146: syntax error: missing ';' before identifier 'delay_us'
1>\libhdhomerun-master\hdhomerun_os_posix.c(109,30): error C2059: syntax error: ')'
1>\libhdhomerun-master\hdhomerun_os_posix.c(150,6): error C3861: 'pthread_create': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(160,2): error C3861: 'pthread_join': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(165,2): error C3861: 'pthread_mutex_init': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(168,27): error C2065: 'pthread_mutex_t': undeclared identifier
1>\libhdhomerun-master\hdhomerun_os_posix.c(168,44): error C2065: 'mutex': undeclared identifier
1>\libhdhomerun-master\hdhomerun_os_posix.c(168,6): error C2182: 'thread_mutex_dispose': illegal use of type 'void'
1>\libhdhomerun-master\hdhomerun_os_posix.c(168,6): error C2365: 'thread_mutex_dispose': redefinition; previous definition was 'function'
1>\libhdhomerun-master\hdhomerun_os_windows.h(99): message : see declaration of 'thread_mutex_dispose'
1>\libhdhomerun-master\hdhomerun_os_posix.c(169,1): error C2448: 'thread_mutex_dispose': function-style initializer appears to be a function definition
1>\libhdhomerun-master\hdhomerun_os_posix.c(174,2): error C3861: 'pthread_mutex_lock': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(179,2): error C3861: 'pthread_mutex_unlock': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(185,2): error C3861: 'pthread_mutex_init': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(186,2): error C3861: 'pthread_cond_init': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(195,2): error C3861: 'pthread_mutex_lock': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(198,2): error C3861: 'pthread_cond_signal': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(200,2): error C3861: 'pthread_mutex_unlock': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(205,2): error C3861: 'pthread_mutex_lock': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(208,3): error C3861: 'pthread_cond_wait': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(212,2): error C3861: 'pthread_mutex_unlock': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(217,2): error C3861: 'pthread_mutex_lock': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(227,3): error C3861: 'pthread_cond_timedwait': identifier not found
1>\libhdhomerun-master\hdhomerun_os_posix.c(231,2): error C3861: 'pthread_mutex_unlock': identifier not found
1>hdhomerun_os_windows.c
1>hdhomerun_pkt.c
1>hdhomerun_sock_posix.c
1>\libhdhomerun-master\hdhomerun_sock_posix.c(26,10): fatal error C1083: Cannot open include file: 'ifaddrs.h': No such file or directory
1>hdhomerun_sock_windows.c
1>hdhomerun_video.c
1>Done building project "hdhr3.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'd like to make some minor changes to the channel range in https://github.com/Silicondust/libhdhom ... channels.c (line 95) to help with DXing, depending on which frequencies someone is hunting, and there would be an exe for each channel range:

Code: Select all

RF2-6 (vhf-lo)
	{  2,   4,  57000000, 6000000},
	{  5,   6,  79000000, 6000000},
	{  0,   0,         0,       0}
	
RF2-36 (uhf / vhf-hi / vhf-lo)
	{  2,   4,  57000000, 6000000},
	{  5,   6,  79000000, 6000000},
	{  7,  13, 177000000, 6000000},
	{ 14,  36, 473000000, 6000000},
	{  0,   0,         0,       0}

RF7-36 (uhf / vhf-hi)
	{  7,  13, 177000000, 6000000},
	{ 14,  36, 473000000, 6000000},
	{  0,   0,         0,       0}
	
RF14-36 (uhf)
	{ 14,  36, 473000000, 6000000},
	{  0,   0,         0,       0}

nickk
Silicondust
Posts: 16890
Joined: Tue Jan 13, 2004 9:39 am
x 86

Re: [newbie] building hdhomerun_config.exe on Windows 10

Post by nickk »

Hi,

Remove hdhomerun_os_posix.c and hdhomerun_sock_posix.c from the project and try compiling again.

Nick

orbot
Posts: 9
Joined: Wed Mar 03, 2021 11:30 am
Device ID: 1067A183 1067A7DF 106C807A 1067B6F8 1080F019

Re: [newbie] building hdhomerun_config.exe on Windows 10

Post by orbot »

Awesome, that worked, thanks so much!

Post Reply