nmap
nmap copied to clipboard
./libpcap/version:1:1: error: expected unqualified-id when running make on Mac
NOTE: Npcap issues have moved to the Npcap repository
NOTE: Ncrack issues have moved to the Ncrack repository
Describe the bug
On an Intel MacBook running Sonoma 14.1.1, I downloaded the 7.94 source, ran ./configure, and ran make.
I get 20 errors like this and then make fails
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:225: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4
All of the errors refer to ./libpcap/version
I found this old issue (https://github.com/nmap/nmap/issues/1586) that is similar or the same thing, but the fix suggested did not fix my issue.
I noticed that there was a vile named VERSION in /nmap-7.94/libpcap. I renamed this file to <version> and make ran successfully.
To Reproduce On an Intel MacBook running Sonoma 14.1.1, download the 7.94 source, run ./configure, and run make.
Expected behavior Make should run without the ./libpcap/version:1:1: errors
Version info (please complete the following information):
- OS: Intel MacBook running Sonoma 14.1.1
- Output of
nmap --version:Nmap version 7.94 ( https://nmap.org ) Platform: x86_64-apple-darwin23.1.0 Compiled with: nmap-liblua-5.4.4 openssl-3.1.4 libssh2-1.11.0 libz-1.2.12 nmap-libpcre-7.6 nmap-libpcap-1.10.4 nmap-libdnet-1.12 ipv6 Compiled without: Available nsock engines: kqueue poll select - Output of
nmap --iflist`Starting Nmap 7.94 ( https://nmap.org ) at 2023-11-21 15:50 CST Warning: File ./nmap-services exists, but Nmap is using /usr/local/bin/../share/nmap/nmap-services for security and consistency reasons. set NMAPDIR=. to give priority to files in your local directory (may affect the other data files too). INTERFACES DEV (SHORT) IP/MASK TYPE UP MTU MAC lo0 (lo0) 127.0.0.1/8 loopback up 16384 lo0 (lo0) ::1/128 loopback up 16384 lo0 (lo0) fe80::1/64 loopback up 16384 gif0 (gif0) (none)/0 point2point down 1280 stf0 (stf0) (none)/0 other down 1280 en7 (en7) (none)/0 ethernet up 1500 AC:DE:48:00:11:22 en7 (en7) fe80::aede:48ff:fe00:1122/64 ethernet up 1500 AC:DE:48:00:11:22 ap1 (ap1) (none)/0 ethernet down 1500 AA:66:5A:4F:14:F4 en0 (en0) 192.168.1.26/24 ethernet up 1500 88:66:5A:4F:14:F4 en0 (en0) fe80::476:3940:29c7:dad8/64 ethernet up 1500 88:66:5A:4F:14:F4 en0 (en0) fdd9:8c0c:12ef:10:450:743d:9be3:a776/64 ethernet up 1500 88:66:5A:4F:14:F4 en0 (en0) 2605:59c8:18ba:a610:1820:c16a:40fe:7f75/64 ethernet up 1500 88:66:5A:4F:14:F4 en0 (en0) 2605:59c8:18ba:a610:3053:4df6:874e:7b29/64 ethernet up 1500 88:66:5A:4F:14:F4 en0 (en0) 2605:59c8:18ba:a610:ac90:ba89:b10c:a260/64 ethernet up 1500 88:66:5A:4F:14:F4 en0 (en0) 2605:59c8:18ba:a610::6c6/64 ethernet up 1500 88:66:5A:4F:14:F4 awdl0 (awdl0) (none)/0 ethernet up 1500 1A:2C:F4:7E:70:22 awdl0 (awdl0) fe80::182c:f4ff:fe7e:7022/64 ethernet up 1500 1A:2C:F4:7E:70:22 llw0 (llw0) (none)/0 ethernet up 1500 1A:2C:F4:7E:70:22 llw0 (llw0) fe80::182c:f4ff:fe7e:7022/64 ethernet up 1500 1A:2C:F4:7E:70:22 en1 (en1) (none)/0 ethernet up 1500 4A:28:6E:51:4D:85 en3 (en3) (none)/0 ethernet up 1500 4A:28:6E:51:4D:81 en2 (en2) (none)/0 ethernet up 1500 4A:28:6E:51:4D:84 en4 (en4) (none)/0 ethernet up 1500 4A:28:6E:51:4D:80 bridge0 (bridge0) (none)/0 ethernet up 1500 4A:28:6E:51:4D:85 utun0 (utun0) (none)/0 point2point up 1380 utun0 (utun0) fe80::7c9e:4bed:19ec:66ca/64 point2point up 1380 utun1 (utun1) (none)/0 point2point up 2000 utun1 (utun1) fe80::2df6:194b:679e:ae77/64 point2point up 2000 utun2 (utun2) (none)/0 point2point up 1000 utun2 (utun2) fe80::ce81:b1c:bd2c:69e/64 point2point up 1000 utun3 (utun3) (none)/0 point2point up 1500 utun3 (utun3) fe80::1c7b:7fb0:3fc8:2421/64 point2point up 1500 en6 (en6) (none)/0 ethernet up 1500 80:3F:5D:07:BD:2E utun4 (utun4) 10.100.9.131/27 point2point up 1500
ROUTES
DST/MASK DEV METRIC GATEWAY
54.170.42.68/32 en0 0 192.168.1.1
54.217.83.249/32 utun4 0 10.100.9.129
3.33.235.18/32 utun4 0 10.100.9.129
54.231.229.144/32 utun4 0 10.100.9.129
255.255.255.255/32 en0 0
140.82.114.26/32 utun4 0 10.100.9.129
10.100.9.131/32 utun4 0 10.100.9.131
140.82.121.4/32 utun4 0 10.100.9.129
13.224.68.72/32 utun4 0 10.100.9.129
152.199.19.160/32 utun4 0 10.100.9.129
18.66.171.52/32 utun4 0 10.100.9.129
17.57.146.152/32 utun4 0 10.100.9.129
34.205.58.183/32 utun4 0 10.100.9.129
185.166.142.14/32 utun4 0 10.100.9.129
192.168.1.1/32 en0 0
127.0.0.1/32 lo0 0 127.0.0.1
34.228.126.246/32 utun4 0 10.100.9.129
3.237.107.44/32 utun4 0 10.100.9.129
54.170.42.68/32 en0 0 192.168.1.1
185.166.142.19/32 utun4 0 10.100.9.129
3.225.216.238/32 utun4 0 10.100.9.129
52.211.94.64/32 utun4 0 10.100.9.129
208.67.222.222/32 utun4 0 10.100.9.129
44.205.129.79/32 utun4 0 10.100.9.129
13.224.68.60/32 utun4 0 10.100.9.129
52.216.33.208/32 utun4 0 10.100.9.129
18.235.211.214/32 utun4 0 10.100.9.129
169.254.169.254/32 en0 0
34.193.173.92/32 utun4 0 10.100.9.129
185.166.142.18/32 utun4 0 10.100.9.129
3.65.215.106/32 utun4 0 10.100.9.129
185.166.142.20/32 utun4 0 10.100.9.129
44.206.87.165/32 utun4 0 10.100.9.129
192.168.1.26/32 en0 0
63.33.185.197/32 utun4 0 10.100.9.129
107.21.215.86/32 utun4 0 10.100.9.129
45.60.13.212/32 utun4 0 10.100.9.129
10.100.9.128/27 utun4 0 10.100.9.131
192.168.1.0/24 en0 0
169.254.0.0/16 en0 0
127.0.0.0/8 lo0 0 127.0.0.1
224.0.0.0/4 en0 0
0.0.0.0/1 utun4 0 10.100.9.129
128.0.0.0/1 utun4 0 10.100.9.129
0.0.0.0/0 en0 0 192.168.1.1
2a00:1450:400b:c00::5f/128 en0 0 fe80:7::7624:9fff:feb1:56a4
fe80:10::2df6:194b:679e:ae77/128 lo0 0
2a00:1450:400b:c00::6d/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2001:4860:4860::8888/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2607:f8b0:4023:1402::6d/128 en0 0 fe80:7::7624:9fff:feb1:56a4
fe80:f::7c9e:4bed:19ec:66ca/128 lo0 0
fe80:1::1/128 lo0 0
::1/128 lo0 0 ::1
fe80:12::1c7b:7fb0:3fc8:2421/128 lo0 0
2a03:2880:f275:1c6:face:b00c:0:7260/128 en0 0 fe80:7::7624:9fff:feb1:56a4
fe80:11::ce81:b1c:bd2c:69e/128 lo0 0
2a00:1450:400e:80c::2003/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c00::bc/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c01::5e/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c02::66/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c02::bc/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c03::53/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c03::54/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c03::5f/128 en0 0 fe80:7::7624:9fff:feb1:56a4
2a00:1450:400b:c03::71/128 en0 0 fe80:7::7624:9fff:feb1:56a4
fe80:11::/64 utun2 0 fe80:11::ce81:b1c:bd2c:69e
fe80:7::/64 en0 0
fe80:12::/64 utun3 0 fe80:12::1c7b:7fb0:3fc8:2421
fe80:10::/64 utun1 0 fe80:10::2df6:194b:679e:ae77
fe80:f::/64 utun0 0 fe80:f::7c9e:4bed:19ec:66ca
2605:59c8:18ba:a610::/64 en0 0
fe80:8::/64 awdl0 0
fe80:9::/64 llw0 0
fe80:4::/64 en7 0
fdd9:8c0c:12ef:10::/64 en0 0
fe80:1::/64 lo0 0 fe80:1::1
2605:59c8:18ba:a600::/56 en0 0 fe80:7::7624:9fff:feb1:56a4
fdd9:8c0c:12ef::/48 en0 0 fe80:7::7624:9fff:feb1:56a4
ff02:4::/32 en7 0
ff02:12::/32 utun3 0 fe80:12::1c7b:7fb0:3fc8:2421
ff01:12::/32 utun3 0 fe80:12::1c7b:7fb0:3fc8:2421
ff02:11::/32 utun2 0 fe80:11::ce81:b1c:bd2c:69e
ff02:10::/32 utun1 0 fe80:10::2df6:194b:679e:ae77
ff02:f::/32 utun0 0 fe80:f::7c9e:4bed:19ec:66ca
ff02:9::/32 llw0 0
ff02:8::/32 awdl0 0
ff02:7::/32 en0 0
ff02:1::/32 lo0 0 ::1
ff01:9::/32 llw0 0
ff01:11::/32 utun2 0 fe80:11::ce81:b1c:bd2c:69e
ff01:10::/32 utun1 0 fe80:10::2df6:194b:679e:ae77
ff01:f::/32 utun0 0 fe80:f::7c9e:4bed:19ec:66ca
ff01:1::/32 lo0 0 ::1
ff01:4::/32 en7 0
ff01:7::/32 en0 0
ff01:8::/32 awdl0 0
ff00::/8 lo0 0 ::1
ff00::/8 awdl0 0
ff00::/8 en7 0
ff00::/8 utun1 0 fe80:10::2df6:194b:679e:ae77
ff00::/8 utun0 0 fe80:f::7c9e:4bed:19ec:66ca
ff00::/8 llw0 0
ff00::/8 utun3 0 fe80:12::1c7b:7fb0:3fc8:2421
ff00::/8 en0 0
ff00::/8 utun2 0 fe80:11::ce81:b1c:bd2c:69e
::/0 utun1 0 fe80:10::
::/0 utun3 0 fe80:12::
::/0 en0 0 fe80:7::7624:9fff:feb1:56a4
::/0 utun2 0 fe80:11::
::/0 utun0 0 fe80:f::
**Additional context** Add any other context about the problem here, such as special network type. Here is some of the output from make showing several of the errors:Compiling liblua
make[1]: liblua.a' is up to date. g++ -c -I./liblinear -I./liblua -I./libdnet-stripped/include -I./libpcre -I./libpcap -I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_PLATFORM=\"x86_64-apple-darwin23.1.0\" -DNMAPDATADIR=\"/usr/local/share/nmap\" -D_FORTIFY_SOURCE=2 -no-cpp-precomp -g -O2 -Wall -fno-strict-aliasing charpool.cc -o charpool.o In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:281: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy.h:12: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy_move_common.h:12: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/iterator_operations.h:12: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/iter_swap.h:14: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/swap.h:16: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_nothrow_move_constructible.h:15: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_nothrow_constructible.h:17: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:41: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:281: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy.h:12: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy_move_common.h:12: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/iterator_operations.h:15: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/advance.h:27: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:117: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:281: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy.h:12: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/copy_move_common.h:12: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/iterator_operations.h:15: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/advance.h:27: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:827: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:539: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:290: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:20: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:23: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:97: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:92: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:290: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:20: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:23: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:98: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:307: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory_resource/polymorphic_allocator.h:19: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/stdexcept:48: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iosfwd:101: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:307: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory_resource/polymorphic_allocator.h:20: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/tuple:254: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:307: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory_resource/polymorphic_allocator.h:20: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/tuple:259: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/compare:145: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__compare/compare_partial_order_fallback.h:13: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__compare/partial_order.h:14: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__compare/weak_order.h:14: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__compare/strong_order.h:20: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:315: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:307: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory_resource/polymorphic_allocator.h:20: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/tuple:259: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/compare:157: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:307: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory_resource/polymorphic_allocator.h:20: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/tuple:1860: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/utility:260: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:322: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:3359: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1711: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^ In file included from charpool.cc:70: In file included from ./charpool.h:66: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:3359: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1771: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/nth_element.h:15: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/sort.h:30: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bit:79: ./libpcap/version:1:1: error: expected unqualified-id 1.10.4 ^
Hello everyone,
I have found a solution, simple make
cd libpcap && rm VERSION
And that works !
Hi!
There is a confusion here. You just need to add
--includedir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/
when running ./configure (in addition to any other options you may add). This will ensure that the version file in the MacOSX SDK is correctly included for whatever is needed.
The workaround suggested by @dreky888 works because the libpcap/VERSION file is not found, but the compiler ultimately finds the correct version file. But we're talking of two different files here, libpcap/VERSION and /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/version, and confusion arise due to the lack of the include directory path and the case-insensitive nature of macOS.
Why does nmap have its own version of libpcap?