Link static library into dynamic library

Hi pro,

I have a trouble when compile wrapper of cpgf is bellows:
#ifndef REFLECTION_WRAPPER_CLASS_H_
#define REFLECTION_WRAPPER_CLASS_H_
#include "cpgf/gmetadefine.h"
#include "cpgf/goutmain.h"
#include "cpgf/gmetafield.h"
#include "cpgf/gmetaenum.h"
#include "cpgf/gmetaannotation.h"
#include "cpgf/gmetaoperator.h"
#include "cpgf/gmetaproperty.h"
#include "cpgf/gvariant.h"
#include "REFLECTION_WRAPPER_PARAM_CLASS.h"
using namespace cpgf;
namespace COMMON
{
/**
* @brief The class takes responsibility like an adapter for using reflection
*/
class REFLECTION_WRAPPER_CLASS
{
/**
* @brief Deconstructor
*/
EXPORT virtual ~REFLECTION_WRAPPER_CLASS();

/**
* @brief Invoke to execute method
* @param refl_model The model keep parameters for executing reflection
*/
EXPORT static void execute(boost::shared_ptr<REFLECTION_WRAPPER_PARAM_CLASS> refl_model);

/**
* @brief Get invoke parameter
* @param refl_model
* @return
*/
EXPORT static GVariant invoke_paramater(
boost::shared_ptr<REFLECTION_WRAPPER_PARAM_CLASS> refl_model);

};
} /* namespace WRH_COMMON */

#endif /* REFLECTION_WRAPPER_CLASS_H_ */

Common compile ok and common.lib, common.dll are generated.
But when I include REFLECTION_WRAPPER_CLASS.h in test_common project and I found error "REFLECTION_WRAPPER_CLASS.h(15) : fatal error C1083: Cannot open include file: 'cpgf/gmetadefine.h': No such file or directory".
I have included header of cpgf into test_common but I found error "cpgf\include\cpgf/gstdint.h(129) : error C2371: 'int_fast8_t' : redefinition; different basic types"

The common output console: cl /I .\com\ext\inc /I ..\libs\cpgf\include /D "TARGET_MACHINE=SMEE_X86_64"/D "COMPILE_OS=WIN64_OS" /D "SLS225_10" /D"_CONSOLE" /D"_CRT_SECURE_NO_DEPRECATE" /D"_MB CS" /D"_USE_64BIT_TIME_T" /D"_WINDLL" /D"HOST_MACHINE=1" /D"WIN64" /Od /c /EHsc /TP /W3 /Zi /GS- /MD /Fd"tmp_window\release\vc100.pdb" .\com\int\lib\reflection\REFLECTION_WRAPPER_CLASS.cpp /Fotmp_window\release\ /nologo /errorReport:prom
pt

link tmp_window\release\*.obj /DLL ..\libs\cpgf\lib\cpgf.lib
/OUT:"tmp_window\release\libWRHCommon.dll" /INCREMENTAL /MANIFEST /MANIFESTFILE:"tmp_window\release\libWRHCommon.intermediate.manifest" /SUBSYSTEM:CONSOLE
/MACHINE:X64 /NOLOGO /NOLOGO /ERRORREPORT:PROMPT Creating library tmp_libWRHCommon\release\libWRHCommon.lib and object tmp_libWRHCommon\release\libWRHCommon.exp

mt.exe -nologo -manifest "tmp_window\release\libWRHCommon.intermediate.manifest" -outputresource:tmp_window\release\common.dll

The common & test_common are dynamic library output and using same build command.

Please help me resolve it.

Thanks & best regards,






Last edited on
fatal error C1083: Cannot open include file: 'cpgf/gmetadefine.h': No such file or directory".
This is an include path problem.

I have included header of cpgf into test_common but I found error "cpgf\include\cpgf/gstdint.h(129) : error C2371: 'int_fast8_t' : redefinition; different basic types"
I don't know what gstdint.h is.

The common & test_common are dynamic library output and using same build command.
You've not provided enough information for me to comment on that. For example, are they different?

More importantly, you should not be exporting members of a class. You should export the whole class or nothing.
Topic archived. No new replies allowed.