User forums > Help

rev3921 does not build for MacOSX

(1/1)

bnilsson:
I get this:

--- Quote ---memorymappedfile.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

--- End quote ---

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


http://forums.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

--- End quote ---
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

--- End quote ---

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

--- End quote ---
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

--- End quote ---

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


--- End quote ---

Thanks to Tims S and bnilsson

I'll commit the fixes.

Navigation

[0] Message Index

Go to full version