[RESOLVED] conflicting type attributes specified



  • I use libxl with IBookT.h file:
    @
    namespace libxl {

    template<class TCHAR>
    struct IBookT
    {
        virtual             bool XLAPIENTRY load(const TCHAR* filename) = 0;
        virtual             bool XLAPIENTRY save(const TCHAR* filename) = 0;
    
        <...>
    

    @

    and try to create own child class
    @
    #include "libxl.h"
    template<class TCHAR>
    class CSVBook: public libxl::IBookT<TCHAR>
    {
    bool load(const TCHAR* filename);
    bool save(const TCHAR* filename);
    <...>
    @

    This code works fine at linux, but doesn't compile at windows. Compilation ends with error:
    @
    conflicting type attributes specified for 'bool CSVBook<TCHAR>::load(const TCHAR*) [with TCHAR = char]'
    bool load(const TCHAR* filename);
    ^
    @

    How I can fix this problem?



  • I create object with function
    @
    template<class TCHAR>
    CSVBook<TCHAR>* csvCreateBook();

    template<class TCHAR>
    CSVBook<TCHAR>* csvCreateBook()
    {
    CSVBook<TCHAR>* book;
    book = new CSVBook<TCHAR>;
    return book;
    }
    @

    and this code
    @
    book = csvCreateBook<char>();
    @

    If I comment this last line - application is compiled successfully



  • Problem was in the XLAPIENTRY that I lost in my class


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.