c++ program compiled on Linux won't work on Windoze

  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

I have compiled a simple test "elevator" program which moves a car up and down a building, and outputs it's position and displays it IN the building.

I wanted to test it out on a Windoze box with access to the dos prompt (all xp's over here) so atno/tw tested it out for me. He got the following error:

Quote:
The Alert Title is 16 bit MS-DOS Subsystem
The NTVDM CPU has encountered an illegal instruction. CS:052b IP:040f OP:63 2b 2b 2e 73 Choose 'Close' to terminate the application.


The file works fine in Linux, so I'd imagine there must be some command/option to compile it for windows.

I am going to look around in the man files for g++/gcc to see if I spot anything, but incase you guys know the solution I figured I'd post it here.

The file is: http://before-reality.net/elevator.exe or http://before-reality.net/elevator.bat
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

As far as I know, there is a way to get GCC to compile for the windows platform, but your best bet is just getting the GCC for windows, and compiling it on a windows machine.

Binaries compiled for Linux don't run in Windows or DOS :)
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

yeah but that involves finding a windows box I can compile on...I don't feel like rebooting to windows on mine ;)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Lazy
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

if lilo actually worked I wouldn't mind. But I have to go change bios everytime...and beating the f2 key doesn't work always.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

*lol
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

so make lilo work, I never had a problem with it :)
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

I think it might be my weird hardware set up. Dos hd is slave with cd-rom. I know it's not too difficult to go in there and switch my cables around. Just like it wouldn't be too difficult to go fix fan one of two in my powersupply. I just don't want to turn the computer off! :-P One day, one day.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

*grins -- Like I said..."Lazy"
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

hey don't call me too lazy, I just compiled the latest kernel...that took some effort.... ;)
  • phpSelectah
  • Student
  • Student
  • User avatar
  • Posts: 97

Post 3+ Months Ago

The following may be of interest to you:

mingw
cygwin
http://www.astro.gla.ac.uk/users/paulm/Cross/
http://www.wxwindows.org/technote/crosscmp.htm

Good luck :D
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

hehehe thanks, I definatly just went to both of those sites before I saw your post.... :shock: freaky :shock:

I don't feel like compiling any new programs tonight, maybe tomorrow...no, wont get around to it till saturday night. Wow this week is uh...packed....
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

lazy ;)

// Woah, look at that, exactly 2000 posts difference. 1790 vs 3790 (I'm catching up, lol)

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 82 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.