I’m working on a C++ project where I’m using two DLLs:
-
proj1.dll
: This DLL useslog4cpp
for logging. -
proj2.dll
: This DLL embedsproj1.dll
and also useslog4cpp
fromproj1
.
When I run an executable that uses proj2.dll
, I’m able to generate logs from the functions within proj1
. However, when I try to use log4cpp
(which is already used in proj1
) within proj2
, I encounter a runtime error related to log4cpp
that seems to be associated with getNDC
.
I’ve confirmed that both DLLs are using the same version of log4cpp
, but the error persists. Has anyone encountered a similar issue, or can anyone provide insight into what might be causing this error and how to resolve it?
Additional Information:
-
Development Environment: Visual Studio 6
-
proj1
andproj2
are built using MFC. -
The error seems to be related to
log4cpp
‘sNDC
(Nested Diagnostic Context).
Any guidance or suggestions would be greatly appreciated. Thank you!
I’ve set up both DLLs with the same path to the log4cpp
include and lib folders, and I’ve configured the necessary settings in proj2
as well. However, I suspect that the problem may arise from having log4cpp
linked in both DLLs. It seems that I might need to link log4cpp
only to proj1
, which has the necessary headers and logging configurations, and not to proj2
.
vadansh kulshreshtha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.