libjpeg - C++ error C2061: syntax error : identifier 'FILE' jpeglib issue? -


i'm following walk-through required jpeglib http://www.ijg.org/. after installing files in jpegsr9a.zip , adding code utilizes files, following errors after compiling:

1>  jpeg.cpp 1>c:\libraries\jpeg\jpegsr9a\jpeg\jpeglib.h(974): error c2061: syntax error : identifier 'file' 1>c:\libraries\jpeg\jpegsr9a\jpeg\jpeglib.h(975): error c2061: syntax error : identifier 'file' 1>c:\...\jpeg.h(5): error c2143: syntax error : missing ';' before '*' 1>c:\...\jpeg.h(5): error c4430: missing type specifier - int assumed. note: c++ not support default-int 1>c:\...\jpeg.cpp(11): error c2065: 'pbitmap' : undeclared identifier 1>c:\...\jpeg.cpp(16): error c2065: 'pbitmap' : undeclared identifier 1>c:\...\jpeg.cpp(16): error c2227: left of '->sizex' must point class/struct/union/generic type 1>          type 'unknown-type' 

there lot more, think they're related c2061 errors. i've made mistake when adding libraries?

the following header files in program:

//heightfield.h

#include <windows.h> 

//jpeg.h

#include <windows.h> #include <jpeglib.h> #pragma comment(lib, "jpeg.lib")  timagejpg *swiftloadjpeg(const char *srfilename);  void swifttexturejpeg(unsigned int ttexture [], lpstr strfilename, int id); 

any thoughts appreciated.

when see not recognize identifier, after checking typo in identifier name, missing #include.

since unrecognized variable file, part of input/output interface in standard library, file needed .

how figure out if didn't know already? @ documentation/help file, or functions use file. should specify header file needed.

your second error, c2143, looks missing #include. on line 5. @ line 5. first * comes after identifier, timagejpg. if compiler not recognize timagejpg, won't expecting thing "*" after it. typedef of yours? don't see in copy of jpeglib.h found online, , including jpeglib.h. perhaps there header file own project need include here. or perhaps has not yet been defined, , typedef still needs written.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -