简体   繁体   中英

Implicit declaration of function found in header?

I have the following in my file.h:

#define SetSP(sp)  asm("movq  %0,%%rsp":           : "r" (sp)  )

However, in my file.c file, when I try using it for example:

SetSp(lwp_ptable[lwp_procs].sp);

I get an implicit declaration of function SetSp, when I compile file.c. I have #include "file.h" in file.c. Thoughts?

Your define is SetSP , while you use it as SetSp , note the case difference in letter p . Welcome to case sensitive language...

如果您复制并粘贴了代码,请注意SetSPSetSp (调用宏时,您使用了小写的p)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM