I am new to c++ and visual studio 2012 so probably the problem is between the screen and the chair. I performed the following steps;
Compiled the following source file;
#include <iostream>
#include "protobuffers\genome.pb.h"
int main()
{
genomeMessage::Genome genome;
return 0;
}
Stuck... I get the following error;
1>Source.obj : error LNK2019: unresolved external symbol "public: __cdecl genomeMessage::Genome::Genome(void)" (??0Genome@genomeMessage@@QEAA@XZ) referenced in function main
1>Source.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl genomeMessage::Genome::~Genome(void)" (??1Genome@genomeMessage@@UEAA@XZ) referenced in function main
1>C:\Projects\testproto\x64\Debug\testproto.exe : fatal error LNK1120: 2 unresolved externals
So I know it is not a missing lib file because if I move the lib file the linker complains that it can't find it. The problem is that I have no clue how to fix this ... anyone?
According to this message:
1>Source.obj : error LNK2019: unresolved external symbol "public: __cdecl genomeMessage::Genome::Genome(void)" (??0Genome@genomeMessage@@QEAA@XZ) referenced in function main
1>Source.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl genomeMessage::Genome::~Genome(void)" (??1Genome@genomeMessage@@UEAA@XZ) referenced in function main
the source file that declares genomeMessage::Genome::Genome(void)
and genomeMessage::Genome::~Genome(void)
is not part of your project.
In particular, it sounds like you haven't added the genome.pb.cc
file (which is created by the Protocol Buffers compiler) to your project.