0

To make a long story short my Bluetooth drivers bug out sometimes, and I've been working on a program that will detect this and restart the device. Today I've tried to work on a better way to do such. My source code isn't marked as having any errors, but if I try to compile it I get this mess spat out at me.

C:\Users\[MYNAME]\AppData\Local\Temp\cc9pE701.o:Main.cpp:(.text+0x520): undefined reference to `__imp_CM_Get_DevNode_Status' collect2.exe: error: ld returned 1 exit status

And I've checked around the internet, but I have yet to find someone with this exact problem I've seen some similar ones though none of them seem to have a solution. I'm seriously lost at this point any help is greatly appreciated.

I'm certain that it's to do with the call to CM_Get_DevNode_Status(); but I don't know how to fix this. I have the windows SDK installed, cfgmgr32.dll is working fine, and included cfgmgr32.h in the file. Which unfortunately covers all the things I thought it might be.

Ndev
  • 1
  • 1
    Are you linking with either `Cfgmgr32.lib` or `OneCoreUAP.lib` on Windows 10? - see __Requirements__ https://learn.microsoft.com/en-us/windows/win32/api/cfgmgr32/nf-cfgmgr32-cm_get_devnode_status – Richard Critten Jul 31 '21 at 16:50
  • 1
    [What is an undefined reference/unresolved external symbol error and how do I fix it?: Failure to link against appropriate libraries](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix/12574400#12574400) – Raymond Chen Jul 31 '21 at 16:53
  • @RichardCritten That Might be it I'll look into it and see what I can figure out. – Ndev Jul 31 '21 at 16:54

0 Answers0