Using evernote api

Jan 6, 2011 at 2:15 PM

Hi Don,

Thanks for your help so far.

I tried creating a win32 application in vs express 2008, then add an include to the main unit, e.g: #include <Thrift/Thrift.h>. This compiles and works ok.

To make things simple I wanted to move a console app. I created console app then add above include statement. In this case I get a whole lot of errors (7 to be precise). Could you tell me why this is not working?

Also, in either case, how am I meant to add a "Reference" to the "Evernote API.lib"? The "References" command in the IDE looks like it's specifically for .net stuff.

Thanks
Rael

Coordinator
Jan 6, 2011 at 2:35 PM

I meant adding the reference to Configuration Properties/Linker/Input/Additional Dependencies. For examples of using the API, see client/src/UserStore.cpp and client/src/NoteStore.cpp.

Jan 6, 2011 at 2:43 PM

Thanks for that.

However it doesn't answer my question re console app. If I just add the line: "#include <Thrift/Thrift.h>", the application does not compile.

Coordinator
Jan 6, 2011 at 2:48 PM

What errors do you get?

Jan 6, 2011 at 3:03 PM

Source Code:

#include "stdafx.h"

#include <Thrift/Thrift.h>

int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}

Errors:
1>------ Build started: Project: CppEvernoteTest, Configuration: Debug Win32 ------
1>Compiling...
1>CppEvernoteTest.cpp
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tbinary.h(10) : error C2065: 'BYTE' : undeclared identifier
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tprotocol.h(37) : error C2061: syntax error : identifier 'BYTE'
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tprotocol.h(58) : error C2146: syntax error : missing ';' before identifier 'ReadByte'
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tprotocol.h(58) : error C2433: 'Thrift::Protocol::TProtocol::BYTE' : 'virtual' not permitted on data declarations
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tprotocol.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tprotocol.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tprotocol.h(58) : warning C4183: 'ReadByte': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\thrift\protocol\tprotocol.h(58) : error C2253: 'Thrift::Protocol::TProtocol::ReadByte' : pure specifier or abstract override specifier only allowed on virtual function
1>Build log was saved at "file://c:\Documents and Settings\Main\My Documents\Visual Studio 2008\Projects\CppEvernoteTest\CppEvernoteTest\Debug\BuildLog.htm"
1>CppEvernoteTest - 7 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Coordinator
Jan 6, 2011 at 3:15 PM

Oh. I guess, the default Win32 Console project does not have #include <windows.h> in stdafx.h. That's where BYTE is defined.


Jan 6, 2011 at 6:35 PM

Thanks,it's working now.