This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / help help! 怎么在一个EXE里连两个STATIC LIBRARY?这两个LIB SHARE一些FUNCTION,我联的时候VC报错:a.lib: function xyz is already defined in b.lib.
-scorpio(scorpio);
2001-6-2
(#88011@0)
-
Your a.lib has a xyz function and your b.lib also has a xyz function with the same signature as that xyz in a.lib. Your linker did not know which xyz should be used.
-old(HH);
2001-6-2
(#88377@0)
-
that xyz is a inner function, not the one decleared in lib header file, actually they are class construcure/destructure and common used member functions inside the lib.
-scorpio(scorpio);
2001-6-2
(#88469@0)
-
I think you can't have duplicate name of function in libs, contact your lib vender for a name change.
-blaise(blaise);
2001-6-2
(#88418@0)
-
sample code is here~~~~~~~~
-scorpio(scorpio);
2001-6-3
{1656}
(#88659@0)
-
Where is your cod.h? And please one line has one sentence.
-old(HH);
2001-6-3
(#89017@0)
-
create 2 project, put those defination in project/setting.
-scorpio(scorpio);
2001-6-3
{1384}
(#89043@0)
-
I am very sorry I was wrong in #88377 and I am not able to resolve the problem. It seems there should be enc.h and dec.h in codec.cpp or it is included in the missing codec.h. Sorry again!
-old(HH);
2001-6-3
(#89236@0)
-
oh, sorry, in codec.cpp, #include "codec.h" should be changed to #include "enc.h" and #include "dec.h"
-scorpio(scorpio);
2001-6-4
(#89387@0)
-
if this can be solved by some compiler/link setting, I just wonder why we still need namspace to solve name conflict.
-blaise(blaise);
2001-6-4
(#89338@0)
-
namespace is not applicable to my case coz no name conflicting between the exported enc.h/dec.h. I do know how to solve it (just remove #ifdef/#endif in cod.cpp) but I am not clear about the reason.
-scorpio(scorpio);
2001-6-4
(#89389@0)
-
sorry. should remove them in both cod.cpp and cod.h
-scorpio(scorpio);
2001-6-4
(#89390@0)