Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 174 by gregoire.dlg: Compilation issues on Linux introduced by
commit r846
http://code.google.com/p/opencollada/issues/detail?id=174
What steps will reproduce the problem?
1. Just compile the project on Linux
What version of the product are you using? On what operating system?
I am running Arch Linux with GCC 4.6.1 with the revision 846 of OpenCollada.
I tried to compile trough AUR package opencollada-svn:
https://aur.archlinux.org/packages.php?ID=51534
Please provide any additional information below.
Everything is about revision 846 which is incompatible with Linux and
probably MacOS too. r845 compilation run nicely.
ConvertUTF.h has been included in CommonCharacterBuffer.cpp but the
CMakeLists.txt should be updated accordingly with the inclusion of libUTF
header path.
Some header inclusions like:
CommonIBufferFlusher.h:14 #include <stdlib.h>
CommonFWriteBufferFlusher.cpp:13 #include <cstdio>
CommonFWriteBufferFlusher.cpp:14 #include <errno.h>
are removed but they are needed for me as they are not implicitly included
trough Windows library arcanes on my plateform.
Some types like __int64 are Windows specific. Generally, you should prefer
int64_t standard type from stdint.h. However in the current use, you should
consider off_t (see below).
Constructor FWriteBufferFlusher( const wchar_t* fileName, size_t bufferSize
= DEFAUL_BUFFER_SIZE, const wchar_t* mode=L"wb" ) was commented in the
source code. It has been uncommented. It rely on functions such as _wfopen
which are Windows specific. Such functions for handling wide path don’t
exist in Unix world.
Functions like _ftelli64 and _fseeki64 don’t exist too on Linux. You should
use some code like this to keep the compatibility:
#if /* linux */
#define _FILE_OFFSET_BITS 64
#endif
#include <stdio.h>
#if /* windows */
#define fseeko _fseeki64
#define ftello _ftelli64
typedef __int64 off_t;
#endif
and then you can use fseeko, ftello and off_t instead of _fseeki64,
_ftelli64 and __int64 while keeping the compatibility.
I didn’t try to fix everything to get the project compiling therefore there
could be some other pitfalls.
Many thanks.