Code::Blocks Forums
User forums => Help => Topic started by: bnilsson on May 03, 2007, 07:30:36 am
-
I get this:
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
-
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
(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.
-
It worked.
In memorymappedfile.cpp I added
at line 14:
#if defined(__WXGTK__) || defined(__WXMAC__)
#include "errno.h"
#endif
and at line 222:
#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.
-
It worked.
In memorymappedfile.cpp I added
at line 14:
#if defined(__WXGTK__) || defined(__WXMAC__)
#include "errno.h"
#endif
and at line 222:
#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.