Recent

Author Topic: [SOLVED] Cross-compile windows exe from linux64 machine  (Read 10852 times)

cpicanco

  • Hero Member
  • *****
  • Posts: 674
  • Behavioral Scientist and Programmer
    • Portfolio
Re: Cross-compile windows exe from linux64 machine
« Reply #15 on: May 14, 2017, 08:37:49 pm »
Next step is building for win64 and then testing the stuff out and then write an walkthrough for the wiki.
Be mindful and excellent with each other.
https://github.com/cpicanco/

avra

  • Hero Member
  • *****
  • Posts: 2590
    • Additional info
Re: Cross-compile windows exe from linux64 machine
« Reply #16 on: May 14, 2017, 09:30:45 pm »
Cross-compiling is not easy.
I fully agree and having it properly documented in the wiki would make everyone happy. However for someone looking for the easier way I would like to report nice results with fpcupdeluxe and CodeTyphon.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Handoko

  • Hero Member
  • *****
  • Posts: 5543
  • My goal: build my own game engine using Lazarus
Re: [SOLVED] Cross-compile windows exe from linux64 machine
« Reply #17 on: May 14, 2017, 09:57:45 pm »
Yes, CodeTyphon really makes the cross-compiling much easier. I ever tried it but what I dislike is they forked all the components and maintaining themselves. Their team is not big, maybe the 'real' programmer is 1 person only, it is risky. So I stay on Lazarus/FPC.

cpicanco

  • Hero Member
  • *****
  • Posts: 674
  • Behavioral Scientist and Programmer
    • Portfolio
Re: [SOLVED] Cross-compile windows exe from linux64 machine
« Reply #18 on: May 14, 2017, 10:49:10 pm »
Hi, I tested the executables and they work.

What do you think about adding an example section in:

http://wiki.lazarus.freepascal.org/Cross_compiling_for_Win32_under_Linux:

For example, adding screenshots and the following instructions (of course, giving all credits to Handoko (your're awesome):

https://github.com/cpicanco/stimulus_control/blob/master/docs/compiling/cross_compiling.md

Be mindful and excellent with each other.
https://github.com/cpicanco/

cpicanco

  • Hero Member
  • *****
  • Posts: 674
  • Behavioral Scientist and Programmer
    • Portfolio
Re: [SOLVED] Cross-compile windows exe from linux64 machine
« Reply #19 on: May 14, 2017, 10:55:52 pm »
Quote
My goal: build my own game engine using Lazarus

May I ask, what is the status of the game engine?
Be mindful and excellent with each other.
https://github.com/cpicanco/

Handoko

  • Hero Member
  • *****
  • Posts: 5543
  • My goal: build my own game engine using Lazarus
Re: [SOLVED] Cross-compile windows exe from linux64 machine
« Reply #20 on: May 15, 2017, 08:30:04 am »
What do you think about adding an example section in:
http://wiki.lazarus.freepascal.org/Cross_compiling_for_Win32_under_Linux:

Yes, it is good. And adding some screenshots is better.
If you want to give credit you should credit lots of people here in this forum especially Leledumbo, I learned cross-compiling from their postings.

Quote
My goal: build my own game engine using Lazarus
May I ask, what is the status of the game engine?

Short answer:
It is still too far from pre-alpha :-[, many necessary things have been researched.

Long answer:

Actually what I want to build is a game builder. To make it easier I divided it to several sub projects: Game Engine, Graphics Engine, several sub modules: data, audio, keyboard and mouse. 

The Graphics Engine.
Inspired by QB64, I want users who use my game engine do not need to think about the hardware screen resolution. Similar to QB64, I have built my graphics engine that will automatically stretch the display when being resized. One issue was, text won't look good if the width and height aren't stretch proportionally. This issue has been solved.

The Editor.
I need a kind of TScrollBox/TTreeView to be used in the editor but the available components aren't suitable for my need. So, I have written a module to inherit and add more features to TScrollBox.

Data Module.
My database knowledge is weak. But I know good database systems (FireBird, SQLite, MySQL) require client library to be deployed or installed on users' computer, so they are not in my list. Dbf and Paradox are not in my list too, because I want all the game assets to be saved in a single file. So I wrote my own storage module. It already works, but some improvements still need to be added.

Target OS.
The game builder should be able to run on Linux and Windows, and I want it able to generate code that run on Android. I have learned to how to generate Android binaries. But I will need to research more on OpenGL ES2, which is a new thing to me.

Compiler or Intepreter.
I have done a lot of research about how compiler emit code, it's too advanced for my tiny brain now. So I decided to start with interpreter. I noticed many game builders actually are intepreter for it's own scripting language + graphics library + other modules. I noticed the files deployed by ZGameEditor are player engine + game data. I think it is in my capability do the similar thing.

Single File Deployment.
I managed to combined data files and binaries into a single binary. I barely tried it but it worked on my test. This is an interesting trick, you can read more here:
http://forum.lazarus.freepascal.org/index.php/topic,36674.msg244647.html#msg244647
« Last Edit: May 15, 2017, 08:51:45 am by Handoko »

cpicanco

  • Hero Member
  • *****
  • Posts: 674
  • Behavioral Scientist and Programmer
    • Portfolio
Re: [SOLVED] Cross-compile windows exe from linux64 machine
« Reply #21 on: May 16, 2017, 02:21:59 am »
Yes, Leledumbo is everywhere in this forum.

For me, writing from scratchs a game engine/game builder sounds like a pretty big challenge for a single brain. And I think, by this quick look at your blue prints, that seems you're find your way around. The project I am working on (a GPL teaching machine for behavioral scientists, myself included) have some similar requirements:

Target OS.
Linux, Windows  and Android. I was very happy to see that Android cross compiling is pretty advanced: https://github.com/jmpessoa/lazandroidmodulewizard I will give it try soon.

Single File Deployment.
I would love to have that. But right now I must use zmq library to communicate with pupil eye tracking platform(http://pupil-labs.com, another "started by two guys from MIT" awesome project). With help of people in this forum, I figured out how to static link it under linux. But I am afraid it is impossible under windows because it depends on Redistributable Packages of Visual C++ and Visual Studio... As usual, windows sucks (EULA stuff, but I am not completelly sure about it). A workaround was creating windows builds that do not depends on libzmq (hence missing some features). Also, I need a substitute for bass.dll for playing sounds. I am inclined to move to SDL (https://github.com/ev1313/Pascal-SDL-2-Headers).
« Last Edit: May 16, 2017, 02:24:04 am by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

cpicanco

  • Hero Member
  • *****
  • Posts: 674
  • Behavioral Scientist and Programmer
    • Portfolio
Be mindful and excellent with each other.
https://github.com/cpicanco/

 

TinyPortal © 2005-2018