Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [RESOLVED] conflicting type attributes specified

[RESOLVED] conflicting type attributes specified

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vanchester
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vanchester
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vanchester
        wrote on last edited by
        #3

        Problem was in the XLAPIENTRY that I lost in my class

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved