Re: Missing shared library symbols… that don't seem to be missing

2025-04-28 Thread Andy Smith
Hi, On Mon, Apr 28, 2025 at 08:59:13PM -0400, Greg Wooledge wrote: > The library option (-lxenstat) has to appear *after* any objects that > use it. > > cc -Wall -o foo foo.c -lxenstat Ah, okay. My addition of -c was just coincidence then, and it was the reordering that fixed it. Thanks! Andy

Re: Missing shared library symbols… that don't seem to be missing

2025-04-28 Thread Andy Smith
On Tue, Apr 29, 2025 at 12:44:59AM +, Andy Smith wrote: > What am I doing wrong here? It's been a couple of years and perhaps this > part of my brain has dissolved. Yes, it was just a missing "-c" from the arguments. This works: $ cc -Wall -c foo.c -o foo -lxenstat Thanks, Andy -- https://

Re: Missing shared library symbols… that don't seem to be missing

2025-04-28 Thread Greg Wooledge
On Tue, Apr 29, 2025 at 00:44:59 +, Andy Smith wrote: > $ cc -Wall -lxenstat -o foo foo.c > foo.c:(.text+0x18): undefined reference to `xenstat_init' > collect2: error: ld returned 1 exit status The library option (-lxenstat) has to appear *after* any objects that use it. cc -Wall -o foo foo.

Missing shared library symbols… that don't seem to be missing

2025-04-28 Thread Andy Smith
Hi, What am I doing wrong here? It's been a couple of years and perhaps this part of my brain has dissolved. $ cat foo.c #include #include #include #include #include int main(int argc, char **argv) { xenstat_handle *xhandle = NULL; xhandle = xenstat_init(); if (xhandle == NULL