Software Archive
Read-only legacy content
17060 Discussions

Linking error while working with Module

Intel_C_Intel
Employee
500 Views
In my project, i have a module which has a subroutine BruWiz_Release() which actually calls the COMReleaseObject (pObject).. I call this sub (BruWiz_Release()) from the main once i want to get rid of the object.. This module compiles o.k., but while linking i get an error saying :

main.obj : error LNK2001: unresolved external symbol _BRUWIZ_RELEASE@0
run/bru1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Now if i comment the call statement calling this BruWiz_Release(), it works fine.. Note that there is no argument passed on to the sub..it doesn't required one..

Please help me to work this out..

thanks,
hari nair
0 Kudos
1 Reply
Steven_L_Intel1
Employee
500 Views
You need to add a USE of the module in the main program, so that it can see the definition of BruWiz_Release. Without that, it assumes it's an external routine.

Steve
0 Kudos
Reply