RESOLVED : Building cross compiling environment... lazarus / 62-General ---------------------------------------------------------------------- gelinp · 2015-10-09 05:00 Hi, I'm making 32 bit Windows cross compiling environment with FPC 2.6.4 under linux debian Lessy. I know I have to execute this script under /usr/share/fpcsrc/2.6.4 directory: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cd /usr/share/fpcsrc/2.6.4sudo make clean all OS_TARGET=win32 CPU_TARGET=i386sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usrsudo ln -sf /usr/lib/fpc/3.1.1/ppcross386 /usr/bin/ppcross386 But the first line display errors : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386make: execvp: /usr/local/bin/pwd.exe: Permission non accordéeMakefile:135: *** Compiler .exe not found. Arrêt.gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386make: execvp: /usr/local/bin/pwd.exe: Permission non accordéeMakefile:135: *** Compiler .exe not found. Arrêt. It looks like debian try to execute .exe files with execvp comand ! May be the Makefile dosn't understand I'm under Linux Debian ? What is wrong ? ---------------------------------------------------------------------- lagprogramming · 2015-10-09 07:31 Are you absolutely sure that "sudo" works fine in your system? Verify it by issuing something like "sudo dir /root/", or something like that. You can continue by following one of: 1. Try logging as "root" and run the same commands but without "sudo " text that's in front of each text line. 2. Use fpcup 3. Use getlazarus 4. Use CT 5. Soon there will be an update to the experiment presented at: http://forum.lazarus.freepascal.org/index.php/topic,28561.msg188800.ht ml#msg188800 So, you have alternatives. ---------------------------------------------------------------------- gelinp · 2015-10-09 08:28 Yes, you are right, I'was asking myself it will be a problem with sudo envirnment. May be a problem with PATH variable. I tried already to login as root with su and running the comand sudo make... but it's the same problem. I will have a look this afternoom after my job and I will send you an other message. ---------------------------------------------------------------------- Jonas Maebe · 2015-10-09 09:23 It's may indeed be related to your PATH. The "make" utility has no built-in support for detecting whether you run on a Unix-like system or not, nor a way to request the default file extension for binaries on the current system. We have therefore implemented a heuristic in our makefiles, which assumes that we are running on a Unix-like system if the PATH contains not a single semicolon (, as directories in the PATH are separated by ":" on Unix-like platforms and by ";" on others. Now, this heuristic fails a) on Windows if there is only one directory in the PATH (since there won't be any ";" in that case) b) on Unix-like systems if you have a directory containing "';" in its name in your PATH (although that's extremely rare) Or maybe you simply accidentally used a semicolon instead of a colon as separator when adding a directory to your PATH? ---------------------------------------------------------------------- gelinp · 2015-10-09 12:31 OK, I understand. But I can't find any semicolon into my PATH, into my system... I'm looking for again... Could you please tell me what path I have to watch in detail for this test ? So the first error make displayed  was with /usr/local/bin/pwd.exe file. This .exe and a lot of other (so there is .exe files into my system, Debian is a little crasy !) were all with my name as user, so I set root.stuff proprietary as others files into this directory, and no one with execution flag... I don't know if they need execution flag because they are use as parameter into execvp program, but I tested. The result is worst : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386[sudo] password for gelinp: make: execvp: /usr/local/bin/pwd.exe: Permission non accordéeMakefile:135: *** Compiler .exe not found. Arrêt.gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386/usr/local/bin/pwd.exe: 1: /usr/local/bin/pwd.exe: MZ����@���: not found/usr/local/bin/pwd.exe: 2: /usr/local/bin/pwd.exe: $�a�����������D�����������Rich���PEL��g5�                                                                                        : not found/usr/local/bin/pwd.exe: 3: /usr/local/bin/pwd.exe: Syntax error: "(" unexpectedMakefile:135: *** Compiler .exe not found. Arrêt. The file .bashrc is the very similar for me as normal user and for root user. Because I used mine to edit the root user .bashrc file. ---------------------------------------------------------------------- Jonas Maebe · 2015-10-09 12:40 Quote from: gelinp on October 09, 2015, 02:31:55 pmSo the first error make displayed  was with /usr/local/bin/pwd.exe file. This .exe and a lot of other (so there is .exe files into my system, Debian is a little crasy !) All files under /usr/local are files that you installed yourself. Official Debian packages will never put anything there. Quote were all with my name as user, so I set root.stuff proprietary as others files into this directory, and no one with execution flag... I don't know if they need execution flag because they are use as parameter into execvp program, but I tested. The result is worst : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386[sudo] password for gelinp: make: execvp: /usr/local/bin/pwd.exe: Permission non accordéeMakefile:135: *** Compiler .exe not found. Arrêt.gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386/usr/local/bin/pwd.exe: 1: /usr/local/bin/pwd.exe: MZ����@���: not found/usr/local/bin/pwd.exe: 2: /usr/local/bin/pwd.exe: $�a�����������D�����������Rich���PEL��g5�                                                                                        : not found/usr/local/bin/pwd.exe: 3: /usr/local/bin/pwd.exe: Syntax error: "(" unexpectedMakefile:135: *** Compiler .exe not found. Arrêt.Those errors mean that they are DOS/Windows executables, and that the Linux kernel doesn't know how to execute DOS/Windows executables. Try removing /usr/local/bin from your/root's PATH before building again. ---------------------------------------------------------------------- Handoko · 2015-10-09 12:47 Hi gelinp. I suggest you to use VirtualBox, so you can test build the cross compiler on Ubuntu virtual machine. If it works, then you may copy the result files to your 'real' OS. Note: On the code I gave you, there was a 'fpc/3.1.1' on line no. 4. That because I tried to combine Lazarus with FPC 3.1.1. Sorry, I forgot to change it back to 2.6.4. ---------------------------------------------------------------------- Leledumbo · 2015-10-09 17:08 Quote from: Jonas Maebe on October 09, 2015, 02:40:35 pmTry removing /usr/local/bin from your/root's PATH before building again. Or remove those .exes, your Linux system shouldn't need it. Probably it's installed by accident somehow. ---------------------------------------------------------------------- gelinp · 2015-10-09 17:30 OK, I moved all /usr/local/bin*.exe, all *.dll and all files not executable into a subfolder. Then I executed comands below : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo fpcmakeProcessing Makefile.fpc i386-linux requires:  Writing Makefilegelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386Makefile:215: *** The Makefile doesn't support target i386-win32, please run fpcmake first. Arrêt.  What do you think about this ? I would like to try with 3.1.1 version but I have to download a version with /sur/share/fpcsrc/3.1.1/Makefile ! ---------------------------------------------------------------------- Jonas Maebe · 2015-10-09 17:33 Why did you run fpcmake? fpcmake regenerates the Makefile from Makefile.fpc, and if you don't give any parameters, the generated Makefile only supports your host platform. Run "sudo fpcmake -Tall" to restore support for all targets to your Makefile. ---------------------------------------------------------------------- gelinp · 2015-10-09 18:23 R  E  S  O  L  V  E  D !    Thank you very much ! So the problem was : *.exe files, installed by mistake into /usr/local/bin directory. I have to rebuild Makefile with sudo fpcmake -Tall comand Thank you very much again for all your so helpfull messages ! ---------------------------------------------------------------------- Jonas Maebe · 2015-10-09 18:25 Quote from: gelinp on October 09, 2015, 08:23:36 pm ... I have to rebuild Makefile with sudo fpcmake tall comandWell, no: the original Makefile contained support for all targets. You only had to rebuild it because you first overwrote it with "sudo fpcmake" (without -Tall) ---------------------------------------------------------------------- gelinp · 2015-10-09 19:31 Oui effectivement ! Je laisse quand même mon message avec fpcmake car d'autres ferons peut être la même erreur... Je viens de compiler mon premier programme windows avec Lazarus sous Debian. Je l'ai testé simplement avec wine, et il fonctionne très bien. Merci pour votre aide précieuse !