When i try this:
#define PROTOBUF_USE_DLLS
#include <iostream>
#include <fstream>
#include <string>
#include "profiles.pb.h"
using namespace std;
using namespace profiles;
int main()
{
                 profiles::Profile aaa;
//fstream in("a1.inp", ios::in | ios::binary);
//aaa->ParseFromIstream(&in);    
return 0;
}
I have linker errors:
>main.obj : error LNK2028: unresolved token (0A000340) "public: __thiscall 
profiles::Profile::Profile(void)" (??0Profile@profiles@@$$FQAE@XZ) 
referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>main.obj : error LNK2028: unresolved token (0A000341) "public: virtual 
__thiscall profiles::Profile::~Profile(void)" 
(??1Profile@profiles@@$$FUAE@XZ) referenced in function "int __cdecl 
main(void)" (?main@@$$HYAHXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual 
__thiscall profiles::Profile::~Profile(void)" 
(??1Profile@profiles@@$$FUAE@XZ) referenced in function "int __cdecl 
main(void)" (?main@@$$HYAHXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall 
profiles::Profile::Profile(void)" (??0Profile@profiles@@$$FQAE@XZ) 
referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>c:\users\nowami0tk2\documents\visual studio 
2010\Projects\test3\Release\test3.exe : fatal error LNK1120: 4 unresolved 
externals

Same using pointer:
#define PROTOBUF_USE_DLLS
#include <iostream>
#include <fstream>
#include <string>
#include "profiles.pb.h"
using namespace std;
using namespace profiles;

int main()
{
                 profiles::Profile* aaa;
fstream in("a1.inp", ios::in | ios::binary);
aaa->ParseFromIstream(&in);    
return 0;
}

It compiles, but result with System,AccessViolationException, so how to 
read this file ?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to