0

I got a program which contains two parts, main (written in cpp) and additional (assembler). I want to compile this program using DOSBOX 0.74 and BorlandC compiler.

I've tried this:

bcc32 -tWC mainprogram.cpp

and got as a result:

This program must be run under Win32

Why is wrong and what should I do to run this properly?

gvlasov
  • 18,638
  • 21
  • 74
  • 110
  • 4
    Why are you using a 20-year-old compiler and trying to run the program on an emulated 30-year-old operating system? You might have more joy with this century's tools. – Mike Seymour May 26 '15 at 16:54
  • What if I must do this via DOSBOX? It's an ordinance of my teacher. – g4201971 May 26 '15 at 16:56
  • 3
    Then drop the course. It won't teach you anything useful, unless you're interested in the history of ancient dialects of C++ and obsolete operating systems. – Mike Seymour May 26 '15 at 16:57
  • Okay, I can't argue with that. Anyway, how to make it using other tools? – g4201971 May 26 '15 at 16:59
  • 1
    bcc32 is officially a Windows compiler, so by default 'needs' Windows. Check the commandline parameters - I seem to remember OS=msdos steers the compiler to DOS. – jcoppens May 26 '15 at 17:03
  • So how many schools in your country are stubbornly and forcefully teaching how many people to use emulated DOS ffs and what can we do about it? For the sake of our industry. – Lightness Races in Orbit May 26 '15 at 17:04
  • Generally speaking, following the directions given in error messages, or avoiding the conditions they indicate to be a problem are a good start. Failing that, googling the exact message will provide results for the overwhelming majority of the remaining cases. Whatever the OS and IDE, research is a vital part of programming, get used to(and better at) it! – enhzflep May 26 '15 at 17:23
  • I suspect you confuse "Console" aka "DOS Prompt" and "MSDOS Environment". Please show code - especially the Assembly code. – rkhb May 26 '15 at 18:26
  • http://pastebin.com/tnT5x4aB - here is assembly. – g4201971 May 26 '15 at 20:35
  • Yes, that's MSDOS assemblable with TASM with two syntax errors. Now you need a **MSDOS**-compiler. Google for "borland c++ for dos download" or "borland c for dos download" or visit [Embarcadero (Borland's successor)](http://edn.embarcadero.com/article/20841). Here's [a link on SO](http://stackoverflow.com/questions/15096609/c-compiler-for-ms-dos). – rkhb May 26 '15 at 21:04
  • My question was about something different. I didn't write about it, but I tried to compile it several ways, and my teacher told me that I should do it directly from the prompt using the commend on top. Are you sure that if it comes to hybrid programming, it is suitable to compile it via TASM? – g4201971 May 26 '15 at 21:30

0 Answers0