static function pointer array access function : error LNK2001: unresolved external sy

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Hi ,

I have a class e, which has an array of function pointers. the code has
been posted below. the code doesnt compile. the error shown is

ERROR LNK2001: UNRESOLVED EXTERNAL SYMBOL \"PUBLIC: STATIC INT
(__CDECL*(* E::E_FUNC_PTR)[18])(INT)\"
(?E_FUNC_PTR@E@@2PAY0BC@P6AHH@ZA)

could any one suggest what is wrong with it.

Thanks & Regards,
visu

E.H:
typedef int (*fptr)(int);
class executer_t
{
private:
int i;
static fptr e_func_ptr[18][18];
public:
e();
static fptr get_e_func_ptr(int cd, int cd_len);
static int init_e_func_ptr();
};


E.CPP:
#include "e.h"

fptr e_func_ptr[18][18];

e::e(){
//constructor
}

fptr e::get_e_func_ptr(int cd, int cd_len){
return e::e_func_ptr[cd_len][cd]; //return an element of the static
function pointer array
}

int e::init_e_func_ptr(){
//code for initializing the static array...yet to be
coded
return 0;
}


--
visu_l
------------------------------------------------------------------------
visu_l's Profile: http://www.techenclave.com/forums/member.php?u=2108
View this thread: http://www.techenclave.com/forums/showthread.php?t=56958

The Tech SuperSite for India - www.techenclave.com

.



Relevant Pages

  • Re: [PATCH 0/5] partitions: Changes to fs/partitions for readability and efficiency
    ... I'm also unconvinced that an array of function pointers is any harder to ... if (err) ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
    (Linux-Kernel)
  • Re: Are For loops macros possible?
    ... semicolon after the function definition) is not valid at namespace scope. ... function pointers. ... code above, as the template is ... you don't even have to dynamically initialize the array: ...
    (microsoft.public.vc.language)
  • Re: Is it possible to make void * safer?
    ... that's one big hit when simulating templates over using C++ templates. ... Unless you run it through a C++ compiler, ... That's why I added the function pointers, ... array_push(array, data);} ...
    (comp.lang.c)
  • Re: debugging - help
    ... i am executing on Armulator using AXD debugger. ... What i have is an array of function pointers which get periodically ... I parse this array each time, calling the functions ...
    (comp.lang.c)
  • Re: Optimizing a switch statement
    ... >>A half decent compiler will most likely implement the case statement using ... using a table of function pointers may ... > function pointer array code now gets really interesting... ... table is a better solution than a switch statement, ...
    (comp.lang.c)