So I'm compiling this module for work.
And I'm getting this error when I attempt to load the module into memory:
undefined symbol: sem_wait
Any programmers/linux people know why that would happen? I believe the offending code snippet is this:
#include #define lock_get(lock) sem_wait(lock
(
Read more... )
Comments 15
Reply
Second, I'm pretty sure it is in the correct path, but I'll double check. The module is a custom module that I am writing; the linux kernel is Slackware 2.4.33.3
The version of semaphore.h that I am attempting to use is in /usr/include, which is in the gcc search path.
I've waded through a sea of errors on custom header files and C-files and now I'm being halted by an installed system header...lol.
Thanks again man.
Reply
/join #c
/join #slackware
/join #linux
Someone in one of those channels can probably help you if you ask nicely. Good luck!
Reply
Reply
Where is sem_wait defined? It -should- be w/ the other semaphore stuff, but maybe it's not.
If you don't get an error directly from the #include about the file not found, it's finding it in pulling it in. The problem is
#define lock_get(lock) sem_wait(lock)
only makes every reference to lock_get change to sem_wait in a very text-based manner. sem_wait doesn't even have to be declared for the preprocessor to happily replace all instances of the token lock_get with sem_wait.
After all of the lock_gets are changed to sem_waits, sem_wait is what needs defined. Is there a
struct sem_wait {};
or
typedef struct {} sem_wait;
anywhere?
Reply
Reply
Search for sem_wait in your headers. I'll poke around the net and see which includes are needed. You may have to #define something to pull it in.
Reply
Reply
Leave a comment