Closed xliang-lifesize closed 1 year ago
Build for cmake on latest commit from master:
https://albfan.semaphoreci.com/jobs/0a20a300-db7f-4777-942c-6265823d8d88
how is it possible that a change in order makes a difference?
I use this image for CI
probably move to github actions is a good idea, but still I need more info to make that change, seems irrelevant
I build from my Ubuntu 22.04. GCC (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0. Here is the error(make VERBOSE=1) :
cd /home/tester/project/miraclecast/build/src/dhcp && /usr/bin/cmake -E cmake_link_script CMakeFiles/miracle-dhcp.dir/link.txt --verbose=1
/usr/bin/cc -std=gnu11 -std=gnu11 -rdynamic CMakeFiles/miracle-dhcp.dir/dhcp.c.o CMakeFiles/miracle-dhcp.dir/common.c.o CMakeFiles/miracle-dhcp.dir/ipv4ll.c.o CMakeFiles/miracle-dhcp.dir/client.c.o CMakeFiles/miracle-dhcp.dir/server.c.o -o miracle-dhcp -ludev -lm -lglib-2.0 ../shared/libmiracle-shared.a -lsystemd
/usr/bin/ld: ../shared/libmiracle-shared.a(shl_log.c.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[2]: *** [src/dhcp/CMakeFiles/miracle-dhcp.dir/build.make:162: src/dhcp/miracle-dhcp] Error 1
make[2]: Leaving directory '/home/tester/project/miraclecast/build'
make[1]: *** [CMakeFiles/Makefile2:309: src/dhcp/CMakeFiles/miracle-dhcp.dir/all] Error 2
make[1]: Leaving directory '/home/tester/project/miraclecast/build'
make: *** [Makefile:136: all] Error 2
From the command line, if you move the "../shared/libmiracle-shared.a" before the "-ludev", it will work.
I am not sure why this happen. But looks like the link lib order need be correct(why??)
From this comment, looks as you mention, order is relevant for this
https://stackoverflow.com/a/34513053/848072
Let me know if you can provide a PR (to be properly credited)
this also hit me on 22.04 , and the diff above was enough to resolve it for me - @albfan or @xliang-lifesize
Hi @albfan,
I am really sorry I missed this comment.
I tried to create a PR, but I failed with push the PR by user error. Looks like I don't have the correct user for this project. Or I didn't push it correct. Could you help to create the PR? I found the issue and have the fix. But I learned from the stackoverflow too. So, the credit should go to everyone.
Happy new year!
@xliang-lifesize we only need a name and email like the one you provide on:
git config user.name git config user.email
https://github.com/albfan/miraclecast/pull/472 should be enough, but let me know those details to properly credit you
@xliang-lifesize we only need a name and email like the one you provide on:
git config user.name git config user.email
472 should be enough, but let me know those details to properly credit you
Hi @albfan Here is my config user.name: Xiao Qiang Liang user.email: xliang@lifesize.com
Thank you.
There is build error in ubuntu 22.04 which caused by the newer gcc This is the patch can fix it.