nvcc compiler error but gcc ok?

Im getting an error when compiling with nvcc but not with gcc. I cant see a problem with the code and it works fine under gcc. Im loading a bitmap image into memory with this code and im getting this error:

line 82: error: a value of type "char *" cannot be assigned to an

          entity of type "unsigned char *"

       image->data = (char *) malloc(size);

                   ^

heres the code

struct Image {

    int sizeX;

    int sizeY;

    unsigned char *data;

};

typedef struct Image Image;

int ImageLoad(char *filename, Image *image) {

    FILE *file;

    unsigned long size;                 // size of the image in bytes.

    unsigned long i;                    // standard counter.

    unsigned short int planes;          // number of planes in image (must be 1) 

    unsigned short int bpp;             // number of bits per pixel (must be 24)

    char temp;                          // temporary color storage for bgr-rgb conversion.

   // make sure the file is there.

    if ((file = fopen(filename, "rb"))==NULL)

    {

	printf("File Not Found : %s\n",filename);

	return 0;

    }

    

    // seek through the bmp header, up to the width/height:

    fseek(file, 18, SEEK_CUR);

   // read the width

    if ((i = fread(&image->sizeX, 4, 1, file)) != 1) {

	printf("Error reading width from %s.\n", filename);

	return 0;

    }

    printf("Width of %s: %lu\n", filename, image->sizeX);

    

    // read the height 

    if ((i = fread(&image->sizeY, 4, 1, file)) != 1) {

	printf("Error reading height from %s.\n", filename);

	return 0;

    }

    printf("Height of %s: %lu\n", filename, image->sizeY);

    

    // calculate the size (assuming 24 bits or 3 bytes per pixel).

    size = image->sizeX * image->sizeY * 3;

    printf("\nsize: %d", size);

   // read the planes

   if ((fread(&planes, 2, 1, file)) != 1) {

	printf("Error reading planes from %s.\n", filename);

	return 0;

    }

                printf("\nplanes:%d", planes);

    if (planes != 1) {

	printf("Planes from %s is not 1: %u\n", filename, planes);

	return 0;

    }

   // read the bpp

      	

    if ((i = fread(&bpp, 2, 1, file)) != 1) {

	printf("Error reading bpp from %s.\n", filename);

	return 0;

   }

    printf("\nbpp:%d\n", bpp);

    if (bpp != 24) {

	printf("Bpp from %s is not 24: %u\n", filename, bpp);

	return 0;

    }

	

    // seek past the rest of the bitmap header.

    fseek(file, 24, SEEK_CUR);

   //read the data. 

    	printf("\nimage1: %d\n", image->data);

    	

    	image->data = (char *) malloc(size); //<<<<--------<b>this is line 82 in my code</b>

    if (image->data == NULL) {

  printf("Error allocating memory for color-corrected image data\n");

	return 0;	

	}

   if ((i = fread(image->data, size, 1, file)) != 1) {

	printf("Error reading image data from %s.\n", filename);

	return 0;

    }

   for (i=0;i<size;i+=3) { // reverse all of the colors. (bgr -> rgb)

	temp = image->data[i];

	image->data[i] = image->data[i+2];

	image->data[i+2] = temp;

    }

   

    return 1;

}

Any pointers would be greatly appreciated

baffa

image->data = (unsigned char *) malloc(size) ?