When compile nmap 7.97 from source code in WSL2, undefined reference error about dbus appears. g++ -Wl,-E -Lnbase -Lnsock/src/ -o nmap charpool.o FingerPrintResults.o ...
With all those include_directories defined I am not sure whether cmake actually found g2o. You can check if the cmake variables are populated for your linking setup. Another idea would be to rely more ...