Trying to build apr 1.7 on Windows with Visual Studio, tried 2017 and 2013.
When building the project (Debug|x86) or compiling e.g. dso.c if get the following error message:
1>dso.c
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2143: syntax error: missing ')' before '*'
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2143: syntax error: missing '{' before '*'
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2059: syntax error: ')'
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2061: syntax error: identifier 'apr_winapi_pfn_if_indextoname'
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2059: syntax error: ';'
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2513: ' ': no variable declared before '='
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2065: 'apr_winapi_pfn_if_indextoname': undeclared identifier
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): warning C4047: '=': 'int' differs in levels of indirection from 'int *(__cdecl *)(NET_IFINDEX,PCHAR)'
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2146: syntax error: missing ';' before identifier 'apr_load_dll_func'
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2100: illegal indirection
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): error C2064: term does not evaluate to a function taking 1207 arguments
1>c:\dev\log4cxx\apr\include\arch\win32\apr_arch_misc.h(503): warning C4033: 'apr_winapi_if_indextoname' must return a value
I have succesfully build version 1.65 (after apply the hint from http://letcoderock.blogspot.com/2017/09/build-log4cxx-trunk-on-windows-by.html or Apache Cross Compilation Error ./gen_test_char: cannot execute binary file)
Comparing apr_arch_misc.h of the two version, i have noticed DLL_IPHLPAPI was new to the enum apr_dlltoken_e and Intelisense was complaining about
APR_DECLARE_LATE_DLL_FUNC(DLL_IPHLPAPI, PCHAR, NETIOAPI_API_, if_indextoname, 0, (
NET_IFINDEX InterfaceIndex,
PCHAR InterfaceName),
(InterfaceIndex, InterfaceName));
with "expecting a ')'".
If have changed NETIOAPI_API_ to WINAPI. Do not know if this is correct but the file could now be compiled (after running the above trick with gen_test_char.exe).
But after that I ran into the next Problem:
1>sockaddr.c
1>network_io\unix\sockaddr.c(144): error C2065: 'IF_NAMESIZE': undeclared identifier
1>network_io\unix\sockaddr.c(144): error C2057: expected constant expression
1>network_io\unix\sockaddr.c(144): error C2466: cannot allocate an array of constant size 0
1>network_io\unix\sockaddr.c(144): error C2133: 'scbuf': unknown size
1>network_io\unix\sockaddr.c(1274): error C2065: 'IF_NAMESIZE': undeclared identifier
I have succesfully build apr with gcc in linux/cygwin. I have looked into the the preprocessor substitutions for IF_NAMESIZE and here it is replaced by 44. But I can not find the definiton or where this is set.
Does anyone have an idea how to fix this? And is the above change to WINAPI correct?
Just use cmake to build the Visual Studio Solution:
With
cmake -G "Visual Studio 15 2017" -A x64
the .sln ist properly set up and building the solution works with no errors. Even gen_test_char.exe is build.
Maybe the apr project should make the cmake building instructions a little bit more prominent on their site.
As written in README file:
Note you must manually modify the include\apr.hw file before you
build to change default options
So i just removed line #define _WIN32_WINNT 0x0501 from apr-1.7.0\include\apr.hw
and run nmake -f Makefile.win. Worked fine for me. VS2017 tools, Windows 10.
In case someone else also runs into this problem: I was using cmake + nmake to build APR, but it still didn't work for me.
The reason was that I had old compilation flags to support Windows XP:
cmake -DMIN_WINDOWS_VER=0x0501 ...
Investigating Iphlpapi.h, it seems that netioapi.h and other networking headers used by the current version of APR are supported only starting from Vista onward:
#if (NTDDI_VERSION >= NTDDI_VISTA)
#include <netioapi.h>
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
So in order for the compilation to work, just remove that cmake option or specify a value higher than 0x0600 (the equivalent for Vista).
I am trying to install collectd on RHEL6. While running 'make', i am facing the below issue.
error:
network.c: In function 'network_bind_socket':
network.c:1854: error: 'SOL_SOCKET' undeclared (first use in this function)
network.c:1854: error: (Each undeclared identifier is reported only once
network.c:1854: error: for each function it appears in.)
network.c:1854: error: 'SO_REUSEADDR' undeclared (first use in this function)
make[3]: *** [network_la-network.lo] Error 1
The getsockopt() specifies be included and i have added <sys/socket.h> header in the 'network.c', still I am facing the same issue.
I compile program using openSSL and during compilation I am getting:
error C3861: fips_aes_cbc_encrypt: identifier not found
and functions AES_cbc_encrypt marked with red underline.
What does it mean and how do I fix it?
I am trying to build python netifaces for windows. I am using microsoft visual c++ express 2010 edition. When I run the command python setup.py install I get the following log and errors:
running install
running bdist_egg
running egg_info
writing netifaces.egg-info\PKG-INFO
writing top-level names to netifaces.egg-info\top_level.txt
writing dependency_links to netifaces.egg-info\dependency_links.txt
reading manifest file 'netifaces.egg-info\SOURCES.txt'
writing manifest file 'netifaces.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_ext
building 'netifaces' extension
c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /
W3 /GS- /DNDEBUG -DWIN32=1 -DNETIFACES_VERSION=0.8 -Ic:\python27\include -Ic:\py
thon27\PC /Tcnetifaces.c /Fobuild\temp.win32-2.7\Release\netifaces.obj
netifaces.c
netifaces.c(410) : error C2275: 'PyObject' : illegal use of this type as an expr
ession
c:\python27\include\object.h(108) : see declaration of 'PyObject'
netifaces.c(411) : error C2275: 'PyObject' : illegal use of this type as an expr
ession
c:\python27\include\object.h(108) : see declaration of 'PyObject'
netifaces.c(720) : error C2275: 'PyObject' : illegal use of this type as an expr
ession
c:\python27\include\object.h(108) : see declaration of 'PyObject'
netifaces.c(720) : error C2065: 'dict' : undeclared identifier
netifaces.c(722) : error C2065: 'dict' : undeclared identifier
netifaces.c(722) : warning C4047: '=' : 'int' differs in levels of indirection f
rom 'PyObject *'
netifaces.c(724) : error C2065: 'dict' : undeclared identifier
netifaces.c(734) : error C2065: 'dict' : undeclared identifier
netifaces.c(734) : warning C4047: 'function' : 'PyObject *' differs in levels of
indirection from 'int'
netifaces.c(734) : warning C4024: 'PyDict_SetItemString' : different types for f
ormal and actual parameter 1
netifaces.c(736) : error C2065: 'dict' : undeclared identifier
netifaces.c(736) : warning C4047: 'function' : 'PyObject *' differs in levels of
indirection from 'int'
netifaces.c(736) : warning C4024: 'PyDict_SetItemString' : different types for f
ormal and actual parameter 1
netifaces.c(738) : error C2065: 'dict' : undeclared identifier
netifaces.c(738) : warning C4047: 'function' : 'PyObject *' differs in levels of
indirection from 'int'
netifaces.c(738) : warning C4024: 'PyDict_SetItemString' : different types for f
ormal and actual parameter 1
netifaces.c(744) : error C2065: 'dict' : undeclared identifier
netifaces.c(744) : warning C4047: 'function' : 'PyObject *' differs in levels of
indirection from 'int'
netifaces.c(744) : warning C4024: 'add_to_family' : different types for formal a
nd actual parameter 3
error: command '"c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe"' f
ailed with exit status 2
sorry for the bad formatting
What am I missing?
Rename netifaces.c to netifaces.cpp (and update the setup.py accordingly).
The reason is that with .c extensions, MSVC interprets these files as adhering to C89, which netifaces.c does not follow; more info here:
error C2275 : illegal use of this type as an expression
I am tring to capture video using libvidcap in mac
I got the following errors while installing libvidcap:
quicktime/sg_manager.c:73: error: 'struct sg_source' has no member named 'channel'
quicktime/sg_manager.c:74: error: 'sgDeviceListIncludeInputs' undeclared (first use in this function)
quicktime/sg_manager.c:75: error: 'device_list' undeclared (first use in this function)
quicktime/sg_manager.c:82: error: 'dlr' undeclared (first use in this function)
quicktime/sg_manager.c:103: error: 'SGDeviceInputListPtr' undeclared (first use in this function)
quicktime/sg_manager.c:103: error: expected ';' before 'ilr'
quicktime/sg_manager.c:109: error: 'ilr' undeclared (first use in this function)
quicktime/sg_manager.c:128: warning: implicit declaration of function 'SGDisposeDeviceList'
quicktime/sg_manager.c:128: error: 'struct sg_source' has no member named 'grabber'
I added the QuickTime/QuickTimeComponents.h header in my source, but this did not solve the problem. What else do I need to do?
./configure CFLAGS="-arch i386" LDFLAGS="-arch i386"