I am using Dev-C++ and lambda expression (boost 1.34.1).
I created a dll containing a class. And want other programs to use the memberfunctions in the class.
the dll.h is:
...........................
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
.............
class DLLIMPORT  classA{
 private:
  ...........  
   public:      
   int function1(const int& );
................
};
the dll.cpp is:
# include "dll.h"
........................
int classA::function1(const int& testnumber){
......................
}
.........................
In the classA::function1 in dll.cpp I used the lambda expression and the above dll is created OK.
and the main executable using the dll is:
# include "dll.h"
.................................
int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)
........................
  classA instanceA;
    instanceA.function1(3);
......................
the complier told me no errors but the linker told me that :
[Linker error] undefined reference to `classA::Function1(int const&)'
And I do not know how to solve it.
Does this error occur due to the use of lambda expression?
Can anyone with kindness help me?


 



网易YEAH.NET免费邮箱:您的终身免费邮箱