Problem with Protocol Buffers in Visual Studio 2008 C++

322 views
Skip to first unread message

rkha...@gmail.com

unread,
May 30, 2014, 4:10:43 AM5/30/14
to prot...@googlegroups.com

Hello from Uzbekistan, Central Asia!

(forgive me for my bad english)

Please help create a dynamic link library (dll) from the attached omnicomm.proto file.

I am writing a program in Visual Basic 6 and I need to deserialize the data from the onboard GPS-logger. Also I have Visual Studio 2008 installed.

 

1. I have Protocol Buffers 2.5.0 full source downloaded from here: http://code.google.com/p/protobuf/downloads/list, unpacked.

 

2. Read the readme.txt, go to “vsprojects” folder, read the readme.txt again))), compiled solution “protobuf.sln”.

 

3. With protoc.exe, which appeared in “Debug” folder compiled omnicomm.proto, using this command: protoc --proto_path=src --cpp_out=build/gen src/omnicomm.proto

 

4. Compiling successful, I have two files: omnicomm.pb.cc and omnicomm.pb.h

 

5. Copy “google” folder from “include” to C:\Program Files\Microsoft Visual Studio 9.0\VC\include

 

6. Create new Visual Studio 2008 “Win32 dll” project, add files omnicomm.pb.cc and omnicomm.pb.h

 

… and have 64 errors after compiling…

 

Machine language translator from http://Translate.Google.com:

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 

 

Warning 1 warning C4996: 'std :: copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values ​​are correct. To disable this warning, use-D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C + + 'Checked Iterators' C: \ Program Files \ Microsoft Visual Studio 9.0 \ VC \ include \ google \ protobuf \ repeated_field.h 785 omnicomm.pb

Warning 2 warning C4996: 'std :: copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values ​​are correct. To disable this warning, use-D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C + + 'Checked Iterators' C: \ Program Files \ Microsoft Visual Studio 9.0 \ VC \ include \ google \ protobuf \ repeated_field.h 785 omnicomm.pb

Error 3 error LNK2001: unresolved external symbol "" public: virtual __ thiscall google :: protobuf :: Closure :: ~ Closure (void) "(?? 1Closure @ protobuf @ google @ @ UAE @ XZ)" omnicomm.pb.obj omnicomm . pb

Error 4 error LNK2001: unresolved external symbol "" public: virtual __ thiscall google :: protobuf :: internal :: FunctionClosure0 :: ~ FunctionClosure0 (void) "(?? 1FunctionClosure0 @ internal @ protobuf @ google @ @ UAE @ XZ)" omnicomm . pb.obj omnicomm.pb

Error 5 error LNK2001: unresolved external symbol "" public: virtual __ thiscall google :: protobuf :: MessageLite :: ~ MessageLite (void) "(?? 1MessageLite @ protobuf @ google @ @ UAE @ XZ)" omnicomm.pb.obj omnicomm . pb

Error 6 error LNK2001: unresolved external symbol "" public: virtual __ thiscall google :: protobuf :: Message :: ~ Message (void) "(?? 1Message @ protobuf @ google @ @ UAE @ XZ)" omnicomm.pb.obj omnicomm . pb

Error 7 error LNK2001: unresolved external symbol "" class std :: basic_string <char, struct std :: char_traits <char>, class std :: allocator <char>> const google :: protobuf :: internal :: kEmptyString " (?kEmptyString@internal@protobuf@google@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B)" omnicomm.pb.obj omnicomm.pb

 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 

 

How can I create dll from this files using Visual Studio 2008? What is my fault, that I'm doing wrong? I have already created dll using Visual Studio 2008, something like this export functions from the library, it was connect from Visual Basic 6.0 and works successfully:


// mydll.cpp
//

#include "stdafx.h"

extern "C"
{
__declspec(dllexport) bool Func1()
{
        return true;
}

__declspec(dllexport) int Func2()
{
        int a;
        int b;
        int c;
        a = 2;
        b = 3;
        c = a * b;
        return c;
}

__declspec(dllexport) int Func3(int x, int y)
{

        int z;
        z = x + y;
        return z;
}

};

 

Please, help me
omnicomm.proto.zip
Reply all
Reply to author
Forward
0 new messages