News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

rev3921 does not build for MacOSX

Started by bnilsson, May 03, 2007, 07:30:36 AM

Previous topic - Next topic

bnilsson

I get this:
Quotememorymappedfile.cpp: In member function 'long int wxMemoryMappedFile::MapFile(const wxString&, bool)':
memorymappedfile.cpp:112: error: 'errno' was not declared in this scope
memorymappedfile.cpp:121: error: 'errno' was not declared in this scope
memorymappedfile.cpp:131: error: 'errno' was not declared in this scope
memorymappedfile.cpp: In static member function 'static wxULongLong wxMemoryMappedFile::GetFileSize64(wxMemoryMappedFileHandleType)':
memorymappedfile.cpp:223: error: 'off64_t' was not declared in this scope
memorymappedfile.cpp:223: error: expected `;' before 'size'
memorymappedfile.cpp:224: error: 'lseek64' was not declared in this scope
memorymappedfile.cpp:225: error: 'size' was not declared in this scope
memorymappedfile.cpp:229: error: 'size' was not declared in this scope
make[5]: *** [memorymappedfile.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Pecan

#1
Try this. I no longer have a Mac, so you'll have to tell us if it works.


http://forums.next.codeblocks.org/index.php?topic=5824.0;topicseen
problem, building C::B latest on freebsd 6.2


At the top of memorymappedfile.cpp you might add __WXMAC__ or whatever to:

#if defined(__WXGTK__)
    #include "errno.h"
#endif

Please tell me if that also worked.


bnilsson

It worked.
In memorymappedfile.cpp I added
at line 14:
Quote#if defined(__WXGTK__) || defined(__WXMAC__)
    #include "errno.h"
#endif
and at line 222:
Quote#elif defined(__BSD__) || defined(__DARWIN__)
   off_t size = lseek(hFile, 0, SEEK_END);
   lseek(hFile, 0, SEEK_SET);//go back to the start of the file
   if (-1 == size)
   {
      throw wxMemoryMappedInvalidFileSize();
   }
   return wxULongLong(size);   
#else

Thanks a lot. I hope this goes into the next rev.

Pecan

Quote from: bnilsson on May 03, 2007, 08:46:38 PM
It worked.
In memorymappedfile.cpp I added
at line 14:
Quote#if defined(__WXGTK__) || defined(__WXMAC__)
    #include "errno.h"
#endif
and at line 222:
Quote#elif defined(__BSD__) || defined(__DARWIN__)
   off_t size = lseek(hFile, 0, SEEK_END);
   lseek(hFile, 0, SEEK_SET);//go back to the start of the file
   if (-1 == size)
   {
      throw wxMemoryMappedInvalidFileSize();
   }
   return wxULongLong(size);   
#else

Thanks a lot. I hope this goes into the next rev.


Thanks to Tims S and bnilsson

I'll commit the fixes.