mac+windows app

This is a discussion on mac+windows app within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by matsp We would also have to build a system-specific loader that loads our generically supported file-format. So ...

  1. #16
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,614
    Quote Originally Posted by matsp View Post
    We would also have to build a system-specific loader that loads our generically supported file-format. So in Windows, we'd have something that uses VirtualAlloc() to allocate memory for the appliction to run in, and then load the code into the allocated memory.
    But then again, you would need a custom loader, which would have to be compiled into an application somehow, which would repeat the whole argument above. There's no way you're getting a compiled application running on Windows and Linux or Mac (with the same executable).
    And besides, it's just more profitable to compile the code on the different platforms and end up with different binaries. No need to develop expensive special loader systems and testing to make sure it works on all platforms and the extra work and researching it takes to create platform-independent code.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    But then again, you would need a custom loader, which would have to be compiled into an application somehow, which would repeat the whole argument above. There's no way you're getting a compiled application running on Windows and Linux or Mac (with the same executable).
    And besides, it's just more profitable to compile the code on the different platforms and end up with different binaries. No need to develop expensive special loader systems and testing to make sure it works on all platforms and the extra work and researching it takes to create platform-independent code.
    I agree. I was just trying to explain that it IS possible - just not very practical, because, as you explained, you end up with some components that are system dependant, and those need to be developed and compiled for multiple platforms.

    Of course, if you have a HUGE application that you want to produce for multiple platforms, it may be simpler to produce a small layer of "shim" to connect to the OS proper - whether that is a separate loader and API/ABI shim, or just a set of library functions that interface between the application proper and the OS dependant components is a different question.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to Send Mac Address From Client to Server
    By Lieyza197 in forum C Programming
    Replies: 2
    Last Post: 05-27-2009, 09:58 AM
  2. Windows Form App as parent, Directx as child??
    By yetti82 in forum C++ Programming
    Replies: 3
    Last Post: 05-29-2006, 03:04 AM
  3. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 06:05 PM
  4. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  5. Multiple threads, Dos APP, manage windows
    By cbrc00f in forum C Programming
    Replies: 1
    Last Post: 04-15-2003, 06:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21