Created
January 26, 2020 07:12
-
-
Save kprav33n/9b49e78860aa35f0fe80e34be7f89e76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ CC=clang make | |
clang -Wall -Werror -g -lvirt -o memory_coordinator memory_coordinator.c | |
$ file memory_coordinator | |
memory_coordinator: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=3c7d8ae680abbe23b6b030479aee4c95a19dfbf6, for GNU/Linux 3.2.0, with debug_info, not stripped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ CC=gcc make | |
gcc -Wall -Werror -g -lvirt -o memory_coordinator memory_coordinator.c | |
/usr/bin/ld: /tmp/cc0UKDfy.o: in function `getHostMemoryStats': | |
/omscs/aos/src/project1/memory/memory_coordinator.c:8: undefined reference to `virNodeGetMemoryStats' | |
/usr/bin/ld: /omscs/aos/src/project1/memory/memory_coordinator.c:10: undefined reference to `virNodeGetMemoryStats' | |
/usr/bin/ld: /tmp/cc0UKDfy.o: in function `getDomainMemoryStats': | |
/omscs/aos/src/project1/memory/memory_coordinator.c:20: undefined reference to `virDomainMemoryStats' | |
/usr/bin/ld: /omscs/aos/src/project1/memory/memory_coordinator.c:42: undefined reference to `virDomainSetMemory' | |
/usr/bin/ld: /omscs/aos/src/project1/memory/memory_coordinator.c:46: undefined reference to `virDomainSetMemory' | |
/usr/bin/ld: /tmp/cc0UKDfy.o: in function `main': | |
/omscs/aos/src/project1/memory/memory_coordinator.c:53: undefined reference to `virConnectOpen' | |
/usr/bin/ld: /omscs/aos/src/project1/memory/memory_coordinator.c:62: undefined reference to `virConnectListAllDomains' | |
/usr/bin/ld: /omscs/aos/src/project1/memory/memory_coordinator.c:65: undefined reference to `virDomainGetName' | |
/usr/bin/ld: /omscs/aos/src/project1/memory/memory_coordinator.c:67: undefined reference to `virDomainGetInfo' | |
/usr/bin/ld: /omscs/aos/src/project1/memory/memory_coordinator.c:78: undefined reference to `virConnectClose' | |
collect2: error: ld returned 1 exit status | |
make: *** [Makefile:7: memory_coordinator] Error 1 | |
$ gcc --version | |
gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008 | |
Copyright (C) 2019 Free Software Foundation, Inc. | |
This is free software; see the source for copying conditions. There is NO | |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment