Using MFC and CLR in DLL

G

Guest

Hello,

I've created a regular (as opposed to extension) DLL that has MFC support
(in a shared DLL). Everything works fine. I then decided to modify my
configuration so that on the project level I turned on CLR support. Now,
when I try to rebuild my solution I get linker errors

fileName.obj : error LNK2028: unresolved token (0A000ACF) "void __stdcall
_com_issue_error(long)" (?_com_issue_error@@$$FYGXJ@Z) referenced in function
"void __cdecl _com_util::CheckError(long)" (?CheckError@_com_util@@$$FYAXJ@Z)
fileName.obj : error LNK2019: unresolved external symbol "void __stdcall
_com_issue_error(long)" (?_com_issue_error@@$$FYGXJ@Z) referenced in function
"void __cdecl _com_util::CheckError(long)" (?CheckError@_com_util@@$$FYAXJ@Z)

Is having MFC in the DLL plus CLR support at the project level something
that should work? If so, anything you can suggest to help resolve my
compilation problem?

Thanks,
Notre
 
G

Guest

This fixed my linking errors, now I have two warnings:

mfcm80ud.lib(postrawdllmain.obj) : warning LNK4099: PDB 'mfcm80ud.i386.pdb'
was not found with 'E:\Program Files\Microsoft Visual Studio
8\VC\atlmfc\lib\mfcm80ud.lib' or at
'c:\wc\0008\src\rn1relationvs\debug\mfcm80ud.i386.pdb'; linking object as if
no debug info
mfcm80ud.lib(postdllmain.obj) : warning LNK4099: PDB 'mfcm80ud.i386.pdb' was
not found with 'E:\Program Files\Microsoft Visual Studio
8\VC\atlmfc\lib\mfcm80ud.lib' or at
'c:\wc\0008\src\rn1relationvs\debug\mfcm80ud.i386.pdb'; linking object as if
no debug info

Any suggestions?

Thanks!
 
G

Gary Chang[MSFT]

Hi Notre,

The mfcm80ud.i386.pdb is a debug symbol file to the mfcm80ud.dll (MFC
Managed Library - Debug Version). It used to be in the
..\Windows\Systems\Symbols\dll folder. If you do a File Search, can you
find it?

By the way, it would bot be a problem to build your application if that
debug symbol file is absent.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi Gary,

I found it in c:\windows\smybols\dll. How do I get that recognized in my
build? I'm using VS 2005.

I know I can build my application w/o it, but I probably will have problems
debugging into the MFC code, right?

Notre
 
G

Gary Chang[MSFT]

Hi Notre,

I suggest you can add that diretory into the VS2005's symbol path:

Options | Debugging | Symbols


Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

I tried that (actually, Tools | Option | Debugging) but it didn't make a
difference.
 
S

SvenC

Hi Notre,

Notre Poubelle said:
I tried that (actually, Tools | Option | Debugging) but it didn't make a
difference.

Did you get the linker error again? That is a different thing: the above
option specifies the directory for a debug session. Set a breakoint, start
your debug build in the IDE and let it hit the breakpoint.

See if you can find the symbol status for the mfc80: either search the
output window where you should see every loaded module and the information
if symbol files where loaded or execute this command from VC's Command
Window: Debug.ListModules. The text ouput has one column which indicates uf
symbols were loaded. You will find one line for each loaded module.

When you added the symbol directory at the above config menu you should see
that the mfc pdbs have been found. If not, they do not seem to match the
dlls.
 
G

Gary Chang[MSFT]

Hi Notre,

I suggest you can also try to copy that .pdb file(in the system32 folder)
to the ..\Microsoft Visual Studio 8\VC\atlmfc\lib directory.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top