I'm using Windows 10 (64-bit), I have downloaded GNAT GPL 2017, ARM ELF format (hosted on Windows) from http://libre.adacore.com/download/configurations#.
I have created a sample code:
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
Put_Line("Hello from GPS!");
end Hello;
When I build my file everything is fine and it succeed. The problem is, that when I run my program, then get an error:
Error while trying to execute C:\Users\sigger\Desktop\ada\hello: not an executable
When I change property of my project:
Project -> Properties -> Sources -> Main -> Executable names
on hello.exe, then I get an error, that my program can't run on Windows 64-bit.
How can I create an exe file from my ada code on Windows 10?
"ARM ELF" is your problem. If you're trying to run an ARM executable on a Windows x86-64 bit platform, you will not succeed. You need a Windows x86-64 (or Windows x86-32) compiler.
What you downloaded was a "cross-compiler" - runs on one platform (Windows 64), but builds binaries for a different platform (ARM).
On the site you went to, try the "x86 Windows (32-bit)" compiler.
Related
I can not run this sample Rebol script
REBOL []
alert
"Hello World"
on Debian 10 Linux 64-bit OS.
The script is from the official Rebol tutorial.
I'm trying to run it using this command from console:
$ rebol hi
but it fails with error message
Script: "Untitled" (none)
** Script Error: alert has no value
** Near: alert "Hello World"
I use the latest available build for Linux x86-64 from the official Rebol site.
REBOL/Core 2.7.8.4.10 (23-Jan-2016)
Copyright 2016 REBOL Technologies
How to run the script?
Does Rebol support GUI on Linux?
I've found in the documentation Rebol runs on all mainstream platforms:
REBOL is cross-platform.
A program written on Windows runs equally well on Linux, BSD, OS X, and many other platforms... with no changes necessary.
Source: http://www.rebol.com/what-rebol.html
But I tried this script and also an Bookmarks example with layout dialect and they both fail with has no value error.
I also tried to add .r extension to the script but it seems it doesn't matter.
The problem is that Rebol has two versions: core and
view. And core version does not has graphics support. But view version does not support 64-bit Linux directly now. No 64-bit build exists, but there's 32-bit build.
To run an alert example using 32-bit build of Rebol View one may need to install required 32-bit libraries (and if I remember correctly first somehow enable 32-bit arch support on 64-bit linux):
On my Debian 10 machine I needed libx11.so.6 and some other X11 related libs:
$ sudo apt install libx11-6:i386 libxext6:i386 libxt6:i386 libxaw7:i386 libfreetype6:i386
Now the script can be run by command such as:
$ rebol hi.r
I'm developing a Qt program on Linux which I would like to puplish on Windows too. Compiling and static linking for Windows works well with MXE (qtbase installed) how ever I'd like to link my program dynamically.
Dynamic linking works and the program runs under Wine but when I copy the EXE and the DLLs to Windows the program gives an error: 'This application failed to start because it could not find or load the Qt platform plugin "windows" in "".'
On Windows there's windeployqt that puts everything that the application needs to run neatly in one folder. Is there a way for getting this tool (or similar) running on Linux?
You're missing several files needed around the executable.
Get them under "Qt Dir \ Qt Version \ MinGW Version \ plugins \"
Required :
imageformats\
qgif.dll
qico.dll
qjpeg.dll
qwbmp.dll
platforms\
qwindows.dll (that's what the error is talking about)
(if in Debug mode, use these files with a "d" at the end, for example qwindowsd.dll)
I'm not sure about the imageformats, but I had to use them even in programs not using pictures. Try with "platforms\qwindows.dll" first, then add the imageformats if the programs asks to.
See https://doc.qt.io/qt-5/windows-deployment.html for the full info and more precise options. I'm just giving you the explanation.
I develop and run some Fortran Code under Windows (7, 64 bit) using Visual Studio 2010 and ifort.
The code, mostly compiled to a DLL file, is tested on Windows and is deployed approx. 25% of the time to Windows (Windows 2000 up to Windows 7) and 75% to SUSE Linux. While the Windows solution is completely handled by me, the Linux "branch" is compiled by someone other (it is 100% the same code). The Linux branch is compiled with the g95/NAG compiler.
Due to some decisions out of our control, we will change from NAG to gfortran. After some tests, we found the code compiled with gfortran (and some optimisation like -o2) to take about double the time to finish compared to Windows and ifort (no optimisation, full debug). We had a chance to compile the code under Linux and ifort and got about the speed of Windows + ifort. (NAG compiled code is somewhere in between.)
For obvious reasons, we would like to compile the code with ifort for Windows and Linux, so:
Is it possible to compile for SUSE Linux under Windows with ifort (using cmd or Visual Studio 2010)?
I'll answer for Intel - no, you can't compile for Linux in Windows (except using a VM in which case you are really running Linux, as stated above). A VM is a reasonable approach, but you'll have to buy a separate license for ifort on Linux.
Or, as I assume you have a Linux box you will test on, build there (you can SSH to it from your Windows box.) True, you won't have the Visual Studio IDE, but some of our customers use Eclipse (with the Photran plugin) or Code::Blocks with Intel Fortran.
I am developing a software in C++ on windows 32-bit (using MSVC++), but since I want to be able to use my software on every platform, I have decided to use CMake as my build generator.
Therefore, I am still just a beginner in CMake. From the CMake tutorials, I understand that in order to cross compile codes, first a toolchain simulating the target platform should be installed on the host platform. Then using the appropriate target-platform C and C++ compilers provided by this toolchain, CMake would be able to generate makefiles etc.
Now, I want to build my code for Linux platform(GNU/Linux) on a Win32 platform. I tried doing the above procedure using CMake combined with Cygwin and using gcc and g++ as compilers. It built fine, created makefiles, and when I issued "make" in Cygwin terminal, the generated makefiles were "made". Now I have got an executable which I was hoping would run on Linux platform. But on Linux I get the error: bash cannot execute binary file.
Using command file executablename, I realized the executable which is made by the above procedure is of type PE32 which is only for Windows.
Now my question is: Is my understanding of cross-platform build procedure using cmake correct?Or should I just use another Linux toolchain under windows to get a Linux ELF executable? What toolchains come to your mind which would give me what I want?
Many thanks
Setareh
You will want to look here: cmake-toolchains(7) if you do cross compiling. However, I would suggest that you install a Linux VM like virtual box on your windows machine and build naively on Linux. It will compile much faster and you will not have to worry about cross compiling. You can mount the windows disk from the linux VM so you can share the same source tree. The linux VM will compile much faster than gcc running under windows.
Your understanding of CMake is correct... it will determine how to create the build system you request (or is default for the platform you are currently on) based on rules in your CMakeLists.txt file. However, this won't necessarily help you compile for linux on a windows machine if you don't have something installed that can target linux.
To compile targeting linux, you will need to use a linux compiler. The link posted by #stjin tells you how to install one on cygwin. Then, to set up your CMake build, do this in the terminal:
CC=gcc-linux CXX=g++-linux cmake . [options]
This will tell CMake to locate the special linux targeted compilers. Hopefuly, after compiling with these compilers you will be able to run on linux.
I am trying to run PartCover to test the coverage of some tests with Gallio on windows x64. However trying to run it gives the following error.
Retrieving the COM class factory for component with CLSID
{FB20430E-CDC9-45D7-8453-272268002E08} failed due to the following error: 80040153.
Edit: I am using PartCover 2.2.0
The problem is caused by PartCover trying to load a 32 bit dll when it is running under the 64-bit .NET VM.
The trick is to force PartCover to run in the 32 bit VM. In order to do this you have to use a tool called CorFlags.exe to modify the exe and flag it as 32 bit. This is equivalent to it having been built with x86 as its target.
CorFlags (on my machine) is in Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\
To set the 32-bit flag run:
CorFlags.exe PartCover.exe /32BIT+ /Force
I also found that I had to do the same for the program being run (in my case the Gallio test runner)