Change Architecture/Instruction? lazarus / 43-Android ---------------------------------------------------------------------- skom · 2018-06-19 11:06 Is it possible to change the Architecture/Instruction project eg from x86 to ARNv7a already during its creation? If so, how? ---------------------------------------------------------------------- Trenatos · 2018-06-19 13:46 I'm not entirely sure what you're asking.. But you can compile the same source code to many different target platforms, if you have cross compilers set up (use fpcupdeluxe to set up.) I usually code on a Mac and compile to Linux and Windows. ---------------------------------------------------------------------- skom · 2018-06-19 14:03 For example, I would like to set up a project on x86, then change it to, for example, ARMv7 ... I do not know where it sets in an existing project ---------------------------------------------------------------------- Trenatos · 2018-06-19 14:22 You can create a project in x64, then import that project on an Arm setup, should be no problem other than changing the target for compilation. ---------------------------------------------------------------------- HeavyUser · 2018-06-19 14:41 you open the menu project options and go for the config and target tab in the compiler options see attached screen shot. ---------------------------------------------------------------------- Handoko · 2018-06-19 14:44 @skom To change the target of the project: Lazarus main menu > Project Options > Compiler Options > Config and Target > Target platform If it is an Android project (Laz4Android or LAMW), you will also need to configure some more extra things. And for your information, you're not able to compile to the 'some' targets you haven't set your compiler (FPC) to cross compile to. ---------------------------------------------------------------------- Trenatos · 2018-06-19 14:47 @Handoko, that's one of my biggest gripes with Lazarus, it LOOKS like it comes with all sorts of stuff built-in, but in reality requires you to do other setups to actually make it work, like cross compiling, like talking to database, etc., but that's a rant for another day  For just moving between systems, it's really easy if you have Laz set up on both systems. ---------------------------------------------------------------------- Handoko · 2018-06-19 14:56 Yes, cross compiling is painfully hard. It took about a year for me to learn how to cross compile from Linux to Android. Once I managed to do a cross compiling, I wrote it down immediately. I haven't tried but I knew Fpcupdelux is a tool that can help you cross compile easily. I ever tried CodeTyphon, it's awesome. Unfortunately it is become less and less compatible with Lazarus. Here is a list of 'extra' information if anyone interested to know more about cross compiling: Fpcupdelux - cross compiling easily: http://wiki.freepascal.org/fpcupdeluxe#Crosscompiling CodeTyphon - Pascal Visual Programming Studio (Lazarus/FPC clone?): http://www.pilotlogic.com Cross Compile from Linux to Windows: https://forum.lazarus.freepascal.org/index.php/topic,36878 Cross Compile from Linux-x64 to Linux-i386: https://forum.lazarus.freepascal.org/index.php/topic,39081.msg267032.h tml#msg267032 Cross Compile to Android ARM and Intel (LAMW 0.7 only): https://forum.lazarus.freepascal.org/index.php/topic,38777 ---------------------------------------------------------------------- jmpessoa · 2018-06-19 16:37 Hi skom! If you are using LAMW... go to your project folder and look for  "....jni/build-modes/readme.txt" ---------------------------------------------------------------------- Thaddy · 2018-06-19 18:47 Quote from: Trenatos on June 19, 2018, 04:47:57 pmbut in reality requires you to do other setups to actually make it work, like cross compiling, like talking to database, etc., but that's a rant for another day  That's required by all real compilers for a platform that's not native!!! And all database flavors....That makes your remarks extremely silly. It shows you are not a pro. And amateurs usually don't need it. Just make sure your capabilities are OK. That means study. As simple as that... ---------------------------------------------------------------------- skom · 2018-06-19 19:01 Thanks for help ---------------------------------------------------------------------- Trenatos · 2018-06-19 20:36 My issue isn't so much that you have to do things to make it work, but that it looks like you don't. It's right there in the settings, options for selecting target platform, yes the logical assumption is that by selecting that it should just work, there's no greyed out options, no warnings, no links to documentation, etc, nothing to tell you it won't work without extra setup. Just look at fpcupdeluxe, wonderful piece of software, but what it does should be done by the installer on the website, either completely automatically or by checking boxes, which solves the issue of even knowing you're supposed to do something to make it work. Database drivers, same thing, there are a variety of connection options, some which require external drivers and some that don't, but the GUI doesn't tell you that, or where to get drivers. Compare to Java, skipping the cross platform bit because of the whole bytecode thing, using Maven you can just specify what driver you want and it's downloaded for you. With FPC/Laz, I have to go hunt them down online, and no I can't just go download them off of the official website because they don't all carry older versions, which are common in Enterprise shops. I went to write a small REST API that talks to a MySQL database for doing fairly simple work, very common work in Enterprise development, after spending most of a day just looking for drivers I had to give up and went with my usual stack, which comes with MySQL drivers from the start, so I could just start solving the problem. As for actually cross developing.. After installing on a mac, the first thing anyone will notice is that the debugger doesn't work, gotta go turn that off, again not something someone new to the tools would expect. GUI has no info, links or otherwise for info about useful things like $(ProjOutDir), $(TargetOS), and whatnot. At least the Compilation and Linking has explanations and details for the options. If you use threads in your application, you have to add -dUseCThreads to your Custom options, not that the GUI does it for you or even tells you, no you have to start randomly searching the forums to learn that's what you have to do. My point is that the barrier to entry is very high for writing real applications in real dev shops. When looking for a new toolset or language, FPC/Laz comes out at the bottom when comparing against Java, Python, PHP, CFML, etc. due to all the issues I explained above. The website installer should link to the fpcupdeluxe, which should have simple/advanced mode. There's a ton of things you don't know that you don't know when trying to start using Lazarus. Lovely little things like it's hard to even find an example of a select * example on the wiki, most examples are for inserts and updates, not how to actually read the data (Other than how to hook it up to a table) but just about nothing for how to loop and access rows. Quote from: Thaddy on June 19, 2018, 08:47:12 pmQuote from: Trenatos on June 19, 2018, 04:47:57 pmbut in reality requires you to do other setups to actually make it work, like cross compiling, like talking to database, etc., but that's a rant for another day  That's required by all real compilers for a platform that's not native!!! And all database flavors....That makes your remarks extremely silly. It shows you are not a pro. And amateurs usually don't need it. Just make sure your capabilities are OK. That means study. As simple as that...