Cross Compile from Windows to Linux ARM lazarus / 32-Linux ---------------------------------------------------------------------- LA.Center · 2012-03-19 00:24 Hi I am trying to cross compile on Windows 32 to Linux ARM and I get this message: arm-linux-ld.exe: cannot find -lpthread Does anyone know where I can find this lib? ---------------------------------------------------------------------- Andru · 2012-03-19 01:10 When you compile something from Windows to Linux ARM you should already have some standard libs(libc.so, libdl.so, etc.), and libpthread one of them, so this is a bit strange. You need to get GNU/Linux(with support of ARM) distributive where you want to execute your application and extract from there libpthread.so. PS: this situation is very familiar to compilation for Android. Unfortunately FreePascal doesn't support threads for Android at all because of different version of pthreads on Android(there are limited functions of it implemented there, and all functions placed in libc.so instead of libpthread.so). And if you want to use threads on Android you need to use pthreads directly. ---------------------------------------------------------------------- LA.Center · 2012-03-19 07:16 I am actually pointing to android-ndk-r7\platforms\android-8\arch- arm\usr\lib which sould contain all the libs afak. still getting the same link error. ---------------------------------------------------------------------- Andru · 2012-03-19 08:18 Quotewhich sould contain all the libs afak.As I wrote previously in PS - you won't find this library for Android, because there is no libpthread. You need to comment cthreads in uses clause of your project and don't use standard thread functions like BeginThread and so on. ---------------------------------------------------------------------- LA.Center · 2012-03-19 08:44 thx for the info, but I am only using System and Classes unit to create a library.so I don't use any threads and I don't have cthread in my uses clause. my config is FPC 2.7 cross compiled for linux-arm. Is there maybe something I need to specify in project options? ---------------------------------------------------------------------- Andru · 2012-03-19 08:57 QuoteIs there maybe something I need to specify in project options?There is no option for this. Something is definitely using cthreads in your project(because only that unit has {$linklib pthreads} line), or something changed in FreePascal 2.7.x. E.g. I use FreePascal 2.6.x from fix_2_6 branch and there is no problem with pthread till I'm not using cthreads. ---------------------------------------------------------------------- LA.Center · 2012-03-19 09:07 thx a lot for your help, I am giving up and go back to linux for linux-arm development. It would have been cool though to get it working in windows too. BTW: I tried even this: library test; begin end. and it still got the link error, so I am guessing 2.7 branch is not suited for arm-linux ---------------------------------------------------------------------- Andru · 2012-03-19 09:19 Strange... I will try to build FPC 2.7 here and test it. ---------------------------------------------------------------------- Andru · 2012-03-19 09:39 Works for me. I built FreePascal 2.7 and have no problems with pthread(the only problem was path to libdl.so, which is not needed for FreePascal 2.6.x). Custom options of my project contains next: Code: [Select]-Cparmv5 -CfSOFT -XParm-linux-androideabi- -Xd -FD${LazarusDir}..\android-ndk-r7\toolchains\arm-linux- androideabi-4.4.3\prebuilt\windows\bin -Fu${LazarusDir}..\android-ndk-r7\platforms\android-3\arch-arm\usr\lib -FL${LazarusDir}..\android-ndk-r7\platforms\android-3\arch- arm\usr\lib\libdl.so