Hi All,
I know there's a few programmers out here that have written C programs using OpenDoors.
I'm trying to learn how this works, and have started using Visual Studio Code. I've got a small "door game" written, but I'm getting errors when trying to compile it.
Here is my awesome door game... ;)
int main()
{
od_printf("Welcome to my first door program!\n\r");
od_printf("Press a key to return to BBS!\n\r");
od_get_key(TRUE);
od_exit(0, FALSE);
return 0;
}
I do have the #include "OpenDoor.h", and it should be finding it, as it isn't giving me that error anymore... Here is what I am getting:
/usr/bin/ld: /tmp/ccAVxTuQ.o: in function 'main':
main.c:(.text+0x11): undefined reference to 'od_printf'
/usr/bin/ld: main.c:(.text+0x22): undefined reference to 'od_printf'
/usr/bin/ld: main.c:(.text+0x2c): undefined reference to 'od_get_key'
/usr/bin/ld: main.c:(.text+0x3b): undefined reference to 'od_exit' collect2: error: ld returned 1 exit status
I'm guessing it's because I don't have ODoors located in the /usr/lib, but I'm not sure.
If you're building/using ODoors as a static-link library (.a file), then you don't need it anywhere specific, but the linker (gcc, g++ or ld)
does need to be able to find it. And you to have to use the -l option to tell the linker to link with it in the first place (e.g. -lodoors).
Sysop: | Weed Hopper |
---|---|
Location: | Clearwater, FL |
Users: | 12 |
Nodes: | 6 (0 / 6) |
Uptime: | 21:02:49 |
Calls: | 114 |
Calls today: | 2 |
Files: | 50,349 |
D/L today: |
55 files (10,156K bytes) |
Messages: | 297,340 |