Constructor using a filename
Apr 13, 2011 at 6:04am UTC
Hello,
This is my first time trying C++ and I'm having problems with my syntax and getting my program to compile. Basically, I'm just trying to read in a file using a constructor.
Image.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#ifndef Image_H
#define Image_H
#include <iostream>
#include <string>
#include "ImageLib.h"
using namespace std;
class Image {
public :
Image ReadGIF(string filename);
};
#endif
Image.cpp
1 2 3 4
#include "Image.h"
// read Image constructor
Image::image ReadGIF(string filename);
ImageLib.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#pragma once
#include <string>
using namespace std;
#define DllExport __declspec( dllexport )
DllExport image ReadGIF(string filename);
DllExport void WriteGIF(string filename, image inputImage);
DllExport void DeallocateImage(image &inputImage);
DllExport image CopyImage(image inputImage);
DllExport image CreateImage(int rows, int cols);
Yeah...i'm a huge noob. Here is the error:
error C2039: 'image' : is not a member of 'Image'
Last edited on Apr 13, 2011 at 6:08am UTC
Apr 13, 2011 at 6:49am UTC
C++ is case sensitive. Also it looks like there are more problems with your code but I'm about to go to sleep so I'll let others help you with that. ;)
Last edited on Apr 13, 2011 at 6:53am UTC
Topic archived. No new replies allowed.