Uint8_t and unsigned char binding error

I use the template function:

template<typename T> void func(const T& value)
{
    obj->func(value);
}

where obj is the class object:

void my_object::func(int64_t value) { ... }
void my_object::func(uint64_t value) { ... }
void my_object::func(uint32_t value) { ... }
void my_object::func(uint16_t value) { ... }
void my_object::func(uint8_t value) { ... }

The problem is with the overload of uint8_t overriding my_object :: func () . Linker complains about unresolved external characters for overloads that must have an unsigned char parameter .

Should I overload uint8_t overload with unsigned char overload ?

Edit: Now notice that the linker complains about uint64_t and int64_t .

I am compiling on Windows using MSVC ++ 2008 Express .

: , my_object:: func (uint8_t value) ( ), .

+5
2

include #include ( C99)

# include < stdint.h >

+8

, uint8_t typedef ed unsigned char, .

0

All Articles