i am using windows 7 64 bit laptop.i installed turbo c and write programs using dosbox, but i can't run the program.... when run is selected it show some message like not an :exe plz give solution to this problem
64-bit Windows cannot run 8- or 16-bit executables due to limitations of Long Mode. Use gcc via MinGW or Cygwin to build them instead.
It's a DOS program you're building. So you'll have to run it under DOS, too.
Do not use shortcut ctrl+f9 to run program as it is also a shortcut to close DOSBOX. use menu tab to compile and run programs.
If you can "live" with it, I run a VM over my linux and win7 (dual boot) with windows XP as the guest OS. This way, I just boot up the VM as necessary. VMWare and virtualbox are good ones.
Related
I've been writing a C++ TUI application to run in the terminal of my raspberry pi using the ncurses library. I've been doing this using the linux remote C++ development add-on in Visual Studio, but I've run into some hurdles into how I should go about debugging it.
Built into visual studio there is a linux console window which displays the output of the ssh connection visual studio makes with the raspberry pi, so if you're writing a console interface using nothing but std::cout and std::cin it does the job for interacting and debugging the app. Ncurses however does not use the standard input and output streams, and therefore the ncurses interface written in code does not appear in the linux console window.
Therefore, essentially what I want to be able to do is interact with the output of my application on my raspberry pi screen when I build and run my linux solution in visual studio instead of using the linux console window. I want a terminal window with my ncurses application running in debug mode to spawn in on the primary display of my raspberry pi, whilst still having the full debug controls for it in visual studio (like breakpoints and such). I do not know how to do this though.
I have seen in other tutorials for debugging GUI applcations (using, for example, GTK) written for linux using visual studio that the "Pre-launch Command" property found in the debug properties page of the C++ Linux project might be the key to do this. In the GTK GUI tutorial, they put the command export DISPLAY=:0.0 in this property in order for the GUI application in debug mode to spawn in on the primary display of the raspberry pi. This does not work for TUI applications however. I am hoping therefore for the solution to my problem being as simple as finding the right argument to put in this property.
The link to the GUI tutorial I'm referring to here is http://comfilewiki.co.kr/en/doku.php?id=comfilepi:create_a_linux_project:index#specify_the_include_paths_in_the_project_s_properties
Thank you to whoever helps me out.
A RaspberryPi can run some Linux distribution derived from Debian, e.g. Raspbian.
A RaspberryPi has wifi and ethernet. You should be able to configure them to serve ssh(1) thru sshd(8) either thru wifi or thru ethernet.
Once an sshd server is running on your RaspBerryPi, you just use ssh on your Linux cross-development machine to access it on the command line.
The gdb debugger has remote debugging facilities, but you could just run it on the RaspBerryPi accessed thru ssh
I've been writing a C++ TUI application to run in the terminal of my raspberry pi using the ncurses library.
I have a simpler recommendation :
debug your C++ TUI application on your laptop or desktop running some Linux distribution.
Only once it is debugged cross-compile it for your RaspBerryPi.
Most C++ applications can be written with enough care to be easily ported from Debian running on your x86-64 laptop to Raspbian running on your RaspberryPi. Be careful to stick to the C++11 (read n3337) or C++17 standard. Enable most warnings when compiling with a recent GCC, even if it is a cross-compiler. So use at least g++ -g -Wall -Wextra and improve your C++ source code to minimize compiler warnings.
Recommandation: install some Linux distribution on your development laptop or desktop.
For that you just need less than a hundred gigabytes of consecutive free disk space. Both Ubuntu and Debian are very easy to install, and freely downloadable.
Once Linux is running on your laptop or desktop, and Raspbian is running on your RaspberryPi, you just need to connect them e.g. using an Ethernet cable.
I recommend installing the build-essential and crossbuild-essential-arm64 packages on Debian (or Ubuntu) on your Linux laptop. Also consider installing the git version control, the emacs editor (and/or geany and/or visual studio code), the gdb debugger, the g++ compiler, the doxygen documentation generator, perhaps the Qt graphical toolkit, the ninja build automation tool, the GNU guile and/or Python and/or Lua and/or GNU awk scripting language
Don't forget to spend a few days in reading documentation.
I compiled and ran a C++ program using Eclipse on my MacBook Pro. I now need to convert the Unix executable to a windows executable. How do I go about this? Specifally, how do I get this code to run on a Windows machine from the command prompt?
The only way you can get the unix executable to run on a Windows system is using a virtual machine (Something like VMWare or VirtualBox). This isn't REALLY running it on Windows, of course, it's setting up a UNIX system on Windows and running it on that UNIX system.
The executables (and the needed runtime environment) are vastly different between the two systems, you can't just run executables from one on the other.
Your only other option is to setup Eclipse on your Windows system and compile the application there.
You cannot "convert" an executable, you need to recompile for your target system. If you are using a GCC toolchain that is set up for Eclipse and there is no Mac specific code, it should be as easy as moving the project over, setting it up in Eclipse, and recompiling it. If that is too much of a hassle, you can consider setting up a Makefile and using MingW or Cygwin, or even Visual Studio if you'd like. If there is Mac specific code, then you need to look up the appropriate Windows documentation, or use something cross-platform like GTK+ or Qt.
I have an application written in C++ using wxWidgets. How can I compile it for Linux and Unix os like Debian, FreeBSD, CentOS, in Windows?
Thanks!
Not entirely sure if I understood the question, but I think you are asking if you can compile an application for linux using a compiler in the windows environment.
My short answer: No, but.
The but: You may be able to use Cygwin in windows, however I think there is an easier way. If you are uncomfortable with setting up your computer to have multiple partitions and installing linux on at least one of these partitions, you can use VirtualBox, VMWare, or similar virtualization software to "install" linux on your windows machine. From there you can set up build environments and such. As for how, I would leave your windows build as is, but then in create a Makefile for Linux (or use CMake to replace both your windows-specific builder (the vsproj if using visual studio, etc) and linux-specific builder (make)) so that your source will compile both on windows and linux without having to modify the actual code or project.
i would recommend to use CMake as build system
I've been looking all over google for this but never got a clear answer..
I'm trying to write a simple hello world application and make it run under msdos (which I will be installing on a old rig lying around here).
But first things first, I've been trying to compile a normal console application and drop it in dosbox to test it out which doesn't work, just says it's invalid. So I assume I need something else to compile it with. Does this mean I'm obligated to build my code in a msdos environment? Even if this is the case, I have no clue at all how to do this, kinda a msdos dummy..
If anyone can shed some light on my case I would be very grateful!
P.S: I'm running a 64bit system
You can use the free DJGPP compiler for DOS. And here is the documentation for using DJGPP.
I'm assuming that you mean actual DOS and not a command prompt running in Windows.
DOS is a 16-bit OS, so you will need a compiler capable of generating a 16-bit binary. A Windows console application is 32-bit, so it won't run under DOS. You don't have to build your code in a DOS environment, you will just need the right compiler.
As for compilers, you might want to check out OpenWatcom.
Microsoft Visual C++ 1.52 is the only available version of a Microsoft
C++ compiler that supports compiling 16-bit code.
http://social.msdn.microsoft.com/forums/en-US/Vsexpressvc/thread/cfc848e8-a797-42a5-8537-892cfc234123
You need to find an old compiler that will generate 16bit COM files.
Could running it on a 64bit system be an issue?..
Yes, 64-bit Windows cannot execute a 16-bit program. If you install a virtual PC with MS-DOS or a 32-bit Windows system, the virtual PC will be able to execute a 16-bit program.
Do you need to edit your question to say that you're using 64-bit Windows?
It sounds like you are compiling a console app on a modern version of Windows and trying to simply copy it to an old DOS box. The problem is that DOS is not forwards compatible. You cannot run a program compiled with Windows 7 on pre-Windows versions of DOS. The simplest solution is to compile your programs on the DOS box itself. Alternatively, if you want to develop on a newer machine, you need to get a cross-compiler which targets the OS where you want to run your program.
Is there any way I can cross-compile C/C++ code for Windows (XP, Vista, Win7), ideally in 64-bit as well as 32-bit (for Vista and Win7), from a Solaris or OpenSolaris setup? My codebase is already cross-platform, I would like to cross-compile it (generate windows DLLs and EXEs) from Solaris or Linux as part of an automated process.
I would like to use the GCC suite, and would rather not need to use the Cygwin DLLs, if possible.
If it is possible, which tools would I need in my Solaris environment? How would I go about compiling/linking an entire project?
If this is not possible in Solaris, how should I proceed from Linux, considering I would like 32- and 64-bit binaries for all of the versions of Windows I have mentioned?
Thanks in advance for any help!
I'm not sure if you want cross-compilation (creation of Windows EXE files on the the Solaris box) or cross-platform (code that compile on Solaris or Windows). The latter is easier, and to do it you should start by installing the MinGW version of the GCC compiler on your Windows box.
howto: Creating a cross Win32 and Win64 compiler
There is no 64-bit cross-compiler for Windows, you have to compile it using MSVC compiler :(
Er, why not just automate your build process by performing a remote build process? It's what we do - we have CruiseControl.NET on a Windows box which performs remote builds on Linux and Solaris via sshexec. I'm sure it would be possible the other way round.