albfan / miraclecast

Connect external monitors to your system via Wifi-Display specification also known as Miracast
Other
3.86k stars 414 forks source link

Another build error on Ubuntu 22.04 #481

Closed elfzweik closed 1 year ago

elfzweik commented 1 year ago

I was hit by a build error similar to #464. I'm also with Ubuntu 22.04 and gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0. So I assume Iit was caused by the new version of GCC. The error is:

make  all-recursive
make[1]: Entering directory '/home/elf/Downloads/miraclecast/build'
Making all in src
make[2]: Entering directory '/home/elf/Downloads/miraclecast/build/src'
Making all in shared
make[3]: Entering directory '/home/elf/Downloads/miraclecast/build/src/shared'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/elf/Downloads/miraclecast/build/src/shared'
Making all in wifi
make[3]: Entering directory '/home/elf/Downloads/miraclecast/build/src/wifi'
  CCLD     miracle-wifid
/usr/bin/ld: ../shared/.libs/libmiracle-shared.a(shl_log.o): undefined reference to symbol 'lrint@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:442: miracle-wifid] Error 1
make[3]: Leaving directory '/home/elf/Downloads/miraclecast/build/src/wifi'
make[2]: *** [Makefile:538: all-recursive] Error 1
make[2]: Leaving directory '/home/elf/Downloads/miraclecast/build/src'
make[1]: *** [Makefile:422: all-recursive] Error 1
make[1]: Leaving directory '/home/elf/Downloads/miraclecast/build'
make: *** [Makefile:354: all] Error 2

The problem I met is at src/wifi instead of src/dhcp. I tried to patch it by trying the way of #464 and #458. But as a newbie, it is proved beyond my ability after several hours googling stackoverflow and askubuntu。 Could anyone show me a workaround? Thanks a lot!

elfzweik commented 1 year ago

Well, trying to use cmake to compile. And with a several warnings, the compilation finished. And miracle-wifid service is running. But I tried connect as peer, the error is:

elf@elf-ubuntu:~$ sudo miracle-wifictl
[ADD] Link: 2
[wifictl] # select 2
link 2 selected
[wifictl] # list
  LINK INTERFACE                FRIENDLY-NAME                  MANAGED   
     2 wlp60s0                  elf-ubuntu                     yes       

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[wifictl] # p2p-scan
ERROR: cannot change p2p-scanning state on link 2 to 1: Invalid argument (ctl_link_set_p2p_scanning() in /home/elf/Downloads/miraclecast/src/ctl/ctl-wifi.c:739)

And when searching solution to this error, I found that @albfan mentioned acting as peer is WIP. So I tried act as source.

elf@elf-ubuntu:~$ sudo systemctl stop NetworkManager.service
elf@elf-ubuntu:~$ sudo systemctl stop wpa_supplicant.service
elf@elf-ubuntu:~$ sudo miracle-sinkctl
[ADD] Link: 2
[sinkctl] # run 2
ERROR: cannot change p2p-scanning state on link 2 to 1: Invalid argument (ctl_link_set_p2p_scanning() in /home/elf/Downloads/miraclecast/src/ctl/ctl-wifi.c:739)
now running on link 2

And my another PC running Windows 10 cannot find the wireless display. I have no idea what is the cause.

By the way, when my laptop acts as peer, can I use WIFI? When windows connect miracast the wifi is still available. If the wifi is not available when running miraclecast, it is not so useful.

albfan commented 1 year ago

Hi, then this issue should be closed. Any question about #4 should be in that issue or new issue that matches issue subject