Re: Dynamic library
- From: "Nils O. Selåsdal" <noselasd@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 26 Jan 2006 20:21:52 +0100
gamehack@xxxxxxxxx wrote:
Hi all,
I've been trying get an example of loading a .so but it doesn't work. Here's the lib:
#include "stdio.h"
void testme(void) { printf("Hello From Lib!"); }
And this is compiled as: gcc -fPIC -shared file.c -o libmystuff.so
Then here's the file which tries to load it: #include "stdio.h" #include "dlfcn.h"
int main() { printf("Going to call library code\n");
void* handle = dlopen("/home/gamehack/shared/libmystuff.so)",
There we go. You have a ) at the end of your filename.
Be sure to read the "Program Library Howto" as well. .
- Follow-Ups:
- Re: Dynamic library
- From: gamehack
- Re: Dynamic library
- References:
- Dynamic library
- From: gamehack
- Dynamic library
- Prev by Date: Dynamic library
- Next by Date: Re: Dynamic library
- Previous by thread: Dynamic library
- Next by thread: Re: Dynamic library
- Index(es):
Relevant Pages
|