Linking Errors .....any one plz help

  • Thread starter Thread starter omermadni
  • Start date Start date
O

omermadni

Its a COM dll that i generated and tested using debug configuration
.....but now its about to be dilevered and as i try to convert it into
release config. removing DEBUG flags , its really doing me a lot lot
trouble ,...the link errors


ExportDevices error LNK2019: unresolved external symbol
__imp___CrtDbgReport referenced in function "public: static long
__stdcall ATL::CComObject<class
CExportDeviceConfig>::CreateInstance(class ATL::CComObject<class
CExportDeviceConfig> * *)"
(?CreateInstance@?$CComObject@VCExportDeviceConfig@@@ATL@@SGJPAPAV12@@Z)



is shown of each time i try to build ....but whenever i change the
"project settings"
Configuration properties -> C/C++ -> Code Generation -> Runtime library

= Multi-threaded Debug DLL (/MDd) ... the only error reported is "
project returns error while performing registration " .... any
VC/COM/ATL Guru if can suggest me in this , i will be highly obliged .


Regards ,
Madni
 
Its a COM dll that i generated and tested using debug configuration
....but now its about to be dilevered and as i try to convert it into
release config. removing DEBUG flags , its really doing me a lot lot
trouble ,...the link errors
You should use identical runtime library flags (/MT(d) or /MD(d) for all
compilands. From the IDE you can override these in different
configurations.
ExportDevices error LNK2019: unresolved external symbol
__imp___CrtDbgReport referenced in function "public: static long
__stdcall ATL::CComObject<class
CExportDeviceConfig>::CreateInstance(class ATL::CComObject<class
CExportDeviceConfig> * *)"
(?CreateInstance@?$CComObject@VCExportDeviceConfig@@@ATL@@SGJPAPAV12@@Z)
You should compile the class which instantiates the above function
with /MD or /MT (i.e. no trailing d). This will cause the _DEBUG not
to be defined and hence elide references to __CrtDbgReport.
= Multi-threaded Debug DLL (/MDd) ... the only error reported is "
project returns error while performing registration " .... any
VC/COM/ATL Guru if can suggest me in this , i will be highly obliged .

Typically, you have a build step after the DLL has been built successfully,
which performs COM registration. You can debug this step. Simply
select regsvr32.exe as your command (in Project Config->Debugging)
and $(TargetPath) for command arguments. Be sure to take a look at
debugger output window.

-hg
 
My Dear Holger Grund ...

I wonder how great person you could be ....in short my dear thanks a
lot for telling me in so detail the solution and helping me out ....God
bless u ....

Best Regards ,
Madni
 
Now that all the linker errors are vanished .... the problem remain is
a single error stating " error PRJ0019: A tool returned an error code
from "Performing registration" .... this is the command given in post
built event ...
"nmake -f ExportDevicespsCD.mk
regsvr32
.../../../../../../Deployment/WES/ReleaseBin/ExportDevicesps.dll /s /c"

now when i tried "nmaking" this mk file using .Net command prompt
utility , it reported an error message stating
"NMAKE : fatal error U1073: don't know how to make 'dlldata.obj' "
 
Now that all the linker errors are vanished .... the problem remain is
a single error stating " error PRJ0019: A tool returned an error code
from "Performing registration" .... this is the command given in post
built event ...
"nmake -f ExportDevicespsCD.mk
regsvr32
../../../../../../Deployment/WES/ReleaseBin/ExportDevicesps.dll /s /c"

now when i tried "nmaking" this mk file using .Net command prompt
utility , it reported an error message stating
"NMAKE : fatal error U1073: don't know how to make 'dlldata.obj' "
dlldata.obj is typically generated from dlldata.c which in turn is created
by midl (if you have at least one interface definition in the library). It
keeps shared code for the proxy-stub DLL (standard marshaller).

Are you sure that nmake fails when executed from within the IDE?
Does the file ExportDevicesps.dll exist after you build?
Is the dlldata.c file generated (you should rebuild both projects to be
certain)? What's the command line for midl?

-hg
 
1: I'm not sure whether nmake fails when executed from within the IDE .
2: ExportDevices.dll is being generated in the target folder ....but
there is no ExportDevicesps.dll file generated there .
3: yes dlldata.c is created
4: Here is the command line for MIDL " /nologo /env win32 /tlb
"UnicodeReleaseCD/ExportDevices.tlb" carrying "/Os" in "Additional
Options"

thanks for replying
 
1: I'm not sure whether nmake fails when executed from within the IDE .
Just check the output window or the buildlog.htm file.
2: ExportDevices.dll is being generated in the target folder ....but
there is no ExportDevicesps.dll file generated there .

If you have built the PS project (IIRC you must do so explicitly)
and it's not there, something went wrong.
3: yes dlldata.c is created Good.

4: Here is the command line for MIDL " /nologo /env win32 /tlb
"UnicodeReleaseCD/ExportDevices.tlb" carrying "/Os" in "Additional
Options"
Looks ok, even though you shouldn't use /Os unless absolutely
necessary. /Oicf /robust (default for current MIDL) work just
fine for W2K+.

Anyway, something seems to go wrong while building the
proxy stub DLL. What you need are the files generated
by MIDL:

<ProjectName>_i.c : GUIDs for Interfaces, CoClasses etc.
<ProjectName>p.c : Definitions for the marshalling code
dlldata.c : Main PS file (proxy-stub code for many
IDL files can be merged into a single DLL)

All of these should be compiled (yielding *.obj files)
and then linked together.

Theoretically, there's a builtin rule for .c => .obj

I guess, nmake does not consider your dlldata.c
file (maybe because it is generated in the wrong directory)

When you build with nmake from the command line,
can you copy the files mentioned above to the directory
from which you're building and try again?

-hg
 
Back
Top