FFVS-Project-Generator icon indicating copy to clipboard operation
FFVS-Project-Generator copied to clipboard

Invalid switch - "" Error

Open ethosgr opened this issue 2 years ago • 1 comments

I'm trying to build a project but no matter what i tried i always get : ``` Invalid switch - "". Error: Errors detected during compilation :- error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ')' before ':' error C2143: syntax error: missing ';' before 'volatile' error C2059: syntax error: ')' error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2059: syntax error: ')' error C2143: syntax error: missing ')' before ':' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2059: syntax error: ')' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C1083: Cannot open include file: 'unistd.h': No such file or directory error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2065: 'asm': undeclared identifier error C2059: syntax error: ')' error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2065: 'asm': undeclared identifier error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ';' before 'volatile' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' error C2065: 'asm': undeclared identifier error C2143: syntax error: missing ';' before 'volatile' error C2143: syntax error: missing ')' before ':' error C2059: syntax error: ')' Based on the above error(s) there are files required for dependency libraries that are not available Ensure that any required dependencies are available in 'OutDir' based on the supplied configuration options before trying again. Consult the supplied readme for instructions for installing varying dependencies. If a dependency has been cloned from a ShiftMediaProject repository then ensure it has been successfully built before trying again. Removing the offending configuration option can also be used to remove the error.


Any help?

ethosgr avatar Jun 30 '22 10:06 ethosgr

Whats the command line you are passing to FFVS? What version of ffmpeg source code are you runing it against?

Sibras avatar Jun 30 '22 14:06 Sibras

I found that Invalid switch - "" can be triggered by passing --disable-network to project_generate. The full error is:

$ ./ffvs/project_generate.exe --rootdir=ffmpeg-5.1.0 --projdir=ffmpeg-5.1.0/build.debug --disable-network;
[..snip..]
Invalid switch - "".
  Error: Errors detected during compilation :-
         error C2011: 'sockaddr': 'struct' type redefinition
         error C2059: syntax error: 'constant'
         error C2011: 'sockaddr_in': 'struct' type redefinition
         error C2011: 'fd_set': 'struct' type redefinition
         error C2011: 'timeval': 'struct' type redefinition
         error C2011: 'hostent': 'struct' type redefinition
         error C2011: 'netent': 'struct' type redefinition
         error C2011: 'servent': 'struct' type redefinition
         error C2011: 'protoent': 'struct' type redefinition
         error C2011: 'WSAData': 'struct' type redefinition
         error C2011: 'sockproto': 'struct' type redefinition
         error C2011: 'linger': 'struct' type redefinition
         error C2375: 'accept': redefinition; different linkage
         error C2375: 'bind': redefinition; different linkage
         error C2375: 'closesocket': redefinition; different linkage
         error C2375: 'connect': redefinition; different linkage
         error C2375: 'ioctlsocket': redefinition; different linkage
         error C2375: 'getpeername': redefinition; different linkage
         error C2375: 'getsockname': redefinition; different linkage
         error C2375: 'getsockopt': redefinition; different linkage
         error C2375: 'htonl': redefinition; different linkage
         error C2375: 'htons': redefinition; different linkage
         error C2375: 'inet_addr': redefinition; different linkage
         error C2375: 'inet_ntoa': redefinition; different linkage
         error C2375: 'listen': redefinition; different linkage
         error C2375: 'ntohl': redefinition; different linkage
         error C2375: 'ntohs': redefinition; different linkage
         error C2375: 'recv': redefinition; different linkage
         error C2375: 'recvfrom': redefinition; different linkage
         error C2375: 'select': redefinition; different linkage
         error C2375: 'send': redefinition; different linkage
         error C2375: 'sendto': redefinition; different linkage
         error C2375: 'setsockopt': redefinition; different linkage
         error C2375: 'shutdown': redefinition; different linkage
         error C2375: 'socket': redefinition; different linkage
         error C2375: 'gethostbyaddr': redefinition; different linkage
         error C2375: 'gethostbyname': redefinition; different linkage
         error C2375: 'gethostname': redefinition; different linkage
         error C2375: 'getservbyport': redefinition; different linkage
         error C2375: 'getservbyname': redefinition; different linkage
         error C2375: 'getprotobynumber': redefinition; different linkage
         error C2375: 'getprotobyname': redefinition; different linkage
         error C2375: 'WSAStartup': redefinition; different linkage
         error C2375: 'WSACleanup': redefinition; different linkage
         error C2375: 'WSASetLastError': redefinition; different linkage
         error C2375: 'WSAGetLastError': redefinition; different linkage
         error C2375: 'WSAIsBlocking': redefinition; different linkage
         error C2375: 'WSAUnhookBlockingHook': redefinition; different linkage
         error C2375: 'WSASetBlockingHook': redefinition; different linkage
         error C2375: 'WSACancelBlockingCall': redefinition; different linkage
         error C2375: 'WSAAsyncGetServByName': redefinition; different linkage
         error C2375: 'WSAAsyncGetServByPort': redefinition; different linkage
         error C2375: 'WSAAsyncGetProtoByName': redefinition; different linkage
         error C2375: 'WSAAsyncGetProtoByNumber': redefinition; different linkage
         error C2375: 'WSAAsyncGetHostByName': redefinition; different linkage
         error C2375: 'WSAAsyncGetHostByAddr': redefinition; different linkage
         error C2375: 'WSACancelAsyncRequest': redefinition; different linkage
         error C2375: 'WSAAsyncSelect': redefinition; different linkage
         error C2011: 'ip_mreq': 'struct' type redefinition
         error C2061: syntax error: identifier 'IPPROTO'
         error C2059: syntax error: '}'
         error C2061: syntax error: identifier 'IPPROTO'
         error C2059: syntax error: '}'
         error C2065: 'IPPROTO_IPV6': undeclared identifier
         error C2065: 'IPPROTO_IPV6': undeclared identifier
         error C2143: syntax error: missing ')' before '*'
         error C2081: 'ICMP_ERROR_INFO': name in formal parameter list illegal
         error C2143: syntax error: missing '{' before '*'
         error C2059: syntax error: ')'
         error C2054: expected '
         error C2065: 'IPPROTO_IPV6': undeclared identifier
         error C2065: 'IPPROTO_IPV6': undeclared identifier
         Unknown error detected. See ffvs_log.txt for further details.

It can also be generated by passing --enable-demuxer=mov:

$  ./ffvs/project_generate.exe --rootdir=ffmpeg-5.1.0 --projdir=ffmpeg-5.1.0/build.debug   --enable-demuxer=mov;
[..snip..]
Invalid switch - "".
  Error: Errors detected during compilation :-
         error C1083: Cannot open include file: 'unistd.h': No such file or directory
         Based on the above error(s) there are files required for dependency libraries that are not available
         Ensure that any required dependencies are available in 'OutDir' based on the supplied configuration options before trying again.
         Consult the supplied readme for instructions for installing varying dependencies.
         If a dependency has been cloned from a ShiftMediaProject repository then ensure it has been successfully built before trying again.
           Removing the offending configuration option can also be used to remove the error.

ffmpeg 5.1.0 with ffvs 1.11.4. This also occurs with a build of fbafd2f.

jmather-sesi avatar Aug 25 '22 17:08 jmather-sesi

I found that Invalid switch - "" can be triggered by passing --disable-network to project_generate. The full error is: Running the latest FFVS 1.11.5 on the latest ffmpeg master I cannot reproduce this issue project_generate.exe --disable-network works without issue

It can also be generated by passing --enable-demuxer=mov: project_generate.exe --enable-demuxer=mov also does not generate an error on my end

The error your mentioning is due to missing unistd.h which is because Visual Studio does not support it. Any code including unistd.h will not compile in VS so if your getting those errors then there is something wrong with the ffmpeg code your using. FFmpeg checks against msvc compiler support and as such shouldnt include unistd.h anywhere that is not within a preprocessor exclusion. I will also point out that the mov demuxer is enabled by default and there hasnt been any similar problems to what your describing.

Sibras avatar Sep 03 '22 16:09 Sibras