Ft8Pi icon indicating copy to clipboard operation
Ft8Pi copied to clipboard

64 bit linux make issue solution

Open muratbedir opened this issue 7 months ago • 0 comments

If you face while, make like below error (compile ederken aşağıdaki gibi bir hata alırsanız)

ft8.cpp:271:21: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision [-fpermissive] 271 | vAddr = (void)(((unsigned)mbox.virt_addr) + offset); | ^~~~~~~~~~~~~~~~~~~~~~~~ ft8.cpp:271:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 271 | vAddr = (void)(((unsigned)mbox.virt_addr) + offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ft8.cpp:272:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 272 | bAddr = (void)(((unsigned)mbox.bus_addr) + offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

this caused by host operating system is 64 bit code designed for 32 bit (nedeni code 32 bit için dizayn edilmiş ama 64 bit os te complie ediyorsunuz)

easily patch ft8.cpp line 271 and 271 with (ft8.cpp deki 271 ve 272 satırı nı solution ile değiştirin)

🔍 Problematic Code (sould be deleted or remarked with //

vAddr = (void)(((unsigned)mbox.virt_addr) + offset); bAddr = (void)(((unsigned)mbox.bus_addr) + offset);

🛠️ Solution - update with below code

Update your code like this:

#include // or <stdint.h> for C-style

vAddr = (void)((uintptr_t)(mbox.virt_addr) + offset); bAddr = (void)((uintptr_t)(mbox.bus_addr) + offset);

muratbedir avatar May 17 '25 05:05 muratbedir