Building an app on Linux for Windows

2019-08-14 03:41发布

I am new in the programming world and I am really glad that I have finished building my first program. Its a simple C++ game that I programmed in QT on Ubuntu. Now I want to create executable files which contain all the neccessary dependencies, so the program can be ran without having QT and the used libraries.

I've been reading through questions and forum posts for the last two days, but I cant get my head around the process. I know that in order to make the program executable it has to contain all the links to the .so files or the .dll on windows, but I have no idea how to convert from .so to .dll and how to include those into my program.

I really did look at a lot of posts and all of them seemed a bit too advance. Also the whole building, releasing, packaging, deploying processes are not clear to me, but I haven't found any decent information starting from scratch.Can you point me into the right direction ?

Thanks

2条回答
何必那么认真
2楼-- · 2019-08-14 03:49

I can't recommend enough not cross-compiling, get a virtual machine with your target OS and install the native toolchain plus any required libraries. This is simpler, less error-prone, and issues are easier to diagnose.

There's also the massive advantage that you can test the software on the platform you're building on. Remember you'll still need access to your target OS in order to test what you have built, so in reality cross-compiling offers you no advantage.

Of course everything I've said is irrelevant if you're building for an embedded OS whose toolchain is designed for cross-compilation anyway.

查看更多
Root(大扎)
3楼-- · 2019-08-14 03:53

Get a cross-compiler installed on your linux machine, cross-compile Qt. Then cross-compile your code so it can generate executable for windows. I think MinGW has cross compilers for linux.

Check this out How do I configure Qt for cross-compilation from Linux to Windows target?

查看更多
登录 后发表回答