You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ismaël Mejía (JIRA)" <ji...@apache.org> on 2019/03/27 13:11:00 UTC

[jira] [Commented] (AVRO-1979) Errors when using avroccp.lib in Visual studio 2015

    [ https://issues.apache.org/jira/browse/AVRO-1979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16802762#comment-16802762 ] 

Ismaël Mejía commented on AVRO-1979:
------------------------------------

This error is due to trying to link a 64bits library in your 32bits project. You should have both Avro (and boost) in a 32bits version to make it work, or move your project to use the 64bit version of both Avro and boost.

An analysis of the log and the lib reveals `??1DataFileWriterBase@avro@@QAE@XZ` ( Q means that it is public, ‘EA’ non-constant and ‘A’ which means is 64 bits, however your project is expecting `??1DataFileWriterBase@avro@@QEAA@XZ` Notice that the E at the end is the convention for 32 bits. If you are curious you can take a look at the demangled translation here https://demangler.com/

Thanks a lot [~bakjos] for helping me analyze this issue. Awesome job Giovanny!

> Errors when using avroccp.lib in Visual studio 2015
> ---------------------------------------------------
>
>                 Key: AVRO-1979
>                 URL: https://issues.apache.org/jira/browse/AVRO-1979
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.8.1
>         Environment: Windows 7, 64Bit, Visual studio 2015 build for 32 bit debug and release library  
>            Reporter: Dimitrios Klimis
>            Priority: Minor
>
> In my current c++ project I need to use avro c++ serializer. Firstly I built boost 1.6.2 and based on it I build via Visual Studio 2015 the Avro-cpp.sln file as it is mentioned in avro relevant site. From the sIn file I build avrocpp.lib and avrocpp.dll and I added the first to my linker.
>  The code I've created uses the following include files
>  #include "avro/DataFile.hh"   
>  #include "avro/Compiler.hh"   
>  #include "avro/ValidSchema.hh"   
>  #include "avro/Schema.hh"  
>  #include "avro/Generic.hh"    
>  #include "avro/Specific.hh"    
> However when I'm trying to build the project I get the following errors
> error LNK2019: unresolved external symbol "public: void __thiscall avro::DataFileWriterBase::syncIfNeeded(void)  
> error LNK2019: unresolved external symbol "public: __thiscall avro::DataFileWriterBase::DataFileWriterBase(char const *,class avro::ValidSchema const &,unsigned int,enum avro::Codec)"  
> error LNK2019: unresolved external symbol "public: __thiscall avro::DataFileWriterBase::~DataFileWriterBase(void)" (??1DataFileWriterBase@avro@@QAE@XZ) referenced in function "public: void * __thiscall avro::DataFileWriterBase::`scalar deleting destructor'(unsigned int)"  
> error LNK2019: unresolved external symbol "public: void __thiscall avro::DataFileWriterBase::close(void)"  
> error LNK2019: unresolved external symbol "public: void __thiscall avro::DataFileWriterBase::close(void)"  
> error LNK2019: unresolved external symbol "void __cdecl avro::compileJsonSchema(class std::basic_istream<char,struct std::char_traits<char> > &,class avro::ValidSchema &)"  
> error LNK2019: "public: void __thiscall avro::DataFileWriterBase::flush(void)"
> I assume that the linker does not find the definition of the the specific classes DataFileWriterBase and compileJsonSchema.  Please can you give any hint on what is wrong with the above issue?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)