first there was only c code, i added a c++ file and class and used that c code function within my c++ class.
Now i am creating cli wrapper class for my mixed c/c++ code:
my 'c' code:
header file : "Code.h"
#pragma once
extern "C"
{
int perfomtask(int argc,char** argv);
class testclass
{
public :
void begintask(int argc, char **argv);
};
}
code file "code.c"
#include "Code.h"
int perfomtask(int argc, char **argv){...}
my cplusplus code file:
#include "code.h"
void testclass::begintask(int argc, char **argv)
{
perfomtask(argc,argv);
}
now i have tested the working of the above with this main class
int main(int argc, char **argv)
{
testclass obj1;
obj1.begintask(argc,argv);
return 0;
}
now that's about my c/c++ mixed code
now here's my cli wrapper code
header file=
using namespace System;
namespace wrapclass
{
public ref class wrapclass
{
public :
wrapclass();
~wrapclass();
void mynativeclass(int argc,char**argv);
int argc;
char** argv;
private:
testclass *ptestclass;
};
}
code file=
wrapclass::wrapclass::wrapclass()
{
ptestclass = new testclass();
}
wrapclass::wrapclass::~wrapclass()
{
delete ptestclass;
}
void wrapclass::wrapclass::mynativeclass(int argc,char** argv)
{
ptestclass->begintask(argc,argv);
}
now i am getting
error :
error LNK2028: unresolved token (0A00032E) "extern "C" int __cdecl perfomtask(int,char * *)referenced in function "public: void __thiscall testclass::begintask(int,char * *)" could someone help me out on this one any explanation would be appreciated.