Menu

Compile issues under Linux

Help
2007-07-30
2013-04-23
  • Lord Sidius

    Lord Sidius - 2007-07-30

    Hi,

    i tried to make it compile under Linux. I had to add a NO_STDCALL define in the same way as the NO_FASTCALL.
    Also i had to comment out some windows specific code like the windows include and LoadLibrary calls.
    Finally i had to comment out the extern GUID abcd code, not sure why yet...

    I got a few errors saying that there is extra qualification in some member functions (like DoubleBuffer::WriteLongLong or some at dsVariant.hpp like Variant::AsBool()). I fixed them too and then i got stuck in a few odd errors saying that the xxx function is protected or private in that context ( for example cRecordIterator::GetDoubleBuffer() ). I am looking at this now, but if you have any hints it would be very helpful. It is fixed if i promote them to public but this is obviously wrong

    I must note that it compiles fine with Mingw but this uses an older gcc version 3.* while all Linux distros have moved on to 4.1.* which has many differences.

    That all for now

     
    • sakarab

      sakarab - 2007-07-30

      > I had to add a NO_STDCALL define in the same way as the NO_FASTCALL.

      This is normal. I just have thought of it myself.

      > Also i had to comment out some windows specific code like the windows include and LoadLibrary calls.

      I must (and will) handle the whole loading thing differently.

      > i had to comment out the extern GUID abcd code

      No harm here as it was forgotten from a test code. It is not needed anyway, as you already discovered.

      > I got a few errors saying that there is extra qualification in some member functions (like DoubleBuffer::WriteLongLong or some at dsVariant.hpp like Variant::AsBool()). I fixed them too

      This is odd. What was the "extra qualification"? What was the fix?

      > i got stuck in a few odd errors saying that the xxx function is protected or private in that context

      You must tell me the context to give you a hint!! :-)

      The last two errors tell me that you must missing a semicolon somewhere or an #ifdef/#endif pair is not matched properly.

      Send me the code to test it with the other compilers.

       
    • Lord Sidius

      Lord Sidius - 2007-07-30

      It compiles fine under windows with gcc 3.* (i haven't tried ms compiler) so its a gcc 4.* thing

      About the first "qualification" issue check dsVariant.h Variant::AsBool() must become AsBool()
      Gcc is a bit strict about qualifiers as it seems

      About the second "context" issue i just post the entire error list

      :: === smds_gcc, Debug ===
      /home/chriss/Projects/smds/trunk/Src/dsRecord.h:310: error: 'smds::detail::cRecordIterator::cRecordIterator(smds::detail::spData&)' is protected
      /home/chriss/Projects/smds/trunk/Src/dsData.h:88: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsRecord.h:311: error: 'smds::detail::cRecordIterator::cRecordIterator(smds::detail::spData&, size_t)' is protected
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:80: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsRecord.h:311: error: 'smds::detail::cRecordIterator::cRecordIterator(smds::detail::spData&, size_t)' is protected
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:93: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsBuffer.h:73: error: 'template<class T> T smds::detail::cRawBuffer::buffer_field_cast(int) const' is private
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:450: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsBuffer.h:73: error: 'template<class T> T smds::detail::cRawBuffer::buffer_field_cast(int) const' is private
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:453: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsBuffer.h:73: error: 'template<class T> T smds::detail::cRawBuffer::buffer_field_cast(int) const' is private
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:454: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsBuffer.h:73: error: 'template<class T> T smds::detail::cRawBuffer::buffer_field_cast(int) const' is private
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:455: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsBuffer.h:73: error: 'template<class T> T smds::detail::cRawBuffer::buffer_field_cast(int) const' is private
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:456: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsBuffer.h:73: error: 'template<class T> T smds::detail::cRawBuffer::buffer_field_cast(int) const' is private
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:457: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsBuffer.h:83: error: 'ds_string** smds::detail::cRawBuffer::string_ptr_ptr(int) const' is private
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:460: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsRecord.h:305: error: 'smds::detail::DoubleBuffer* smds::detail::cRecordIterator::GetDoubleBuffer() const' is protected
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:497: error: within this context
      /home/chriss/Projects/smds/trunk/Src/dsRecord.h:305: error: 'smds::detail::DoubleBuffer* smds::detail::cRecordIterator::GetDoubleBuffer() const' is protected
      /home/chriss/Projects/smds/trunk/Src/dsData.cpp:500: error: within this context
      :: === Build finished: 24 errors, 0 warnings ===

      If you check the first error
          CDFASTCALL cRecordIterator( spData& container );
          CDFASTCALL cRecordIterator( spData& container, Data::size_type idx );

      the context is
          iterator FASTCALL GetIterator()                                             { return iterator( mData ); }

      This looks like a normal error but the Tablebase is a friend of cRecordIterator and the compiler seems to ignore it...
      As i said if i turn it into public it works ok but this is not acceptable

      As i said earlier the gcc 4.* has many differences from the earlier versions. I have noticed similar errors on template libs on my gentoo box but i have no clue on how to solve this...As an example, sometimes the typename keyword was required (which was not in previous versions) and this caused a lot of breakage

      Better to try in on windows under cigwin which is more "unix" that mingw, if you don't have a linux box. Just make sure you have the latest compilers

      Thats it for now, thanks in advance

       

Log in to post a comment.