Re: Question about developing programs...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 30, 2004 at 08:17:00PM -0500, Andrew Konosky wrote:
> 
> I have been writing a small program in C++ with KDevelop to calculate 
> vectors for physics class, and I have compiled and installed it so that 
> it runs when I type the command in the console, which is really cool! If 
> I want to cross-compile it to make a windows version to give to some of 
> my friends, how would I do that? I'm guessing it would just be a DOS 
> file, since there is no gui?

As long as there is no gui you have the potential of success.

If you cross compile you can expect to link to fixed libraries
(no .dll support).  See cygwin1.dll

In this context cross compiling can be hard.  Focus first on writing portable code.
Since Cygwin has a compiler (http://www.cygwin.com/) you might get one 
of your friends to load the Cygwin tools and compile it.

The ABI (application binary interface) in the windows world
is not equal to Linux you will have to link to a windows library.
Also at another level the API (application programming interface)
in the windows world differs.  Without something like the Cygwin
libraries (.dll) you might have to code around that.  Strict ANSI
code helps cross the gap.   i.e. compile 

     gcc -std=c++98  -pedantic

The good news is that ANSI standard 'c' source will run most any place
once compiled locally.   Caution C++ has gone through a couple cycles
and some C++ is not portable.   The gnu compiler on Cygwin and Linux
is a good common ground on which to work.

 Cygwin is a Linux-like environment for Windows. It consists of two parts: 
  * A DLL (cygwin1.dll) which acts as a Linux emulation layer providing 
    substantial Linux API functionality.
  * A collection of tools, which provide Linux look and feel.

Bottom line is that cross compiling needs to address both the ABI and the API
so you are doing a double cross compile.  Google search for "Cygwin cross compile".
In your cross compile adventures pay attention to the path names of files....

This story is interesting in terms of what was easy and not.

   http://www.octave.org/octave-lists/archive/octave-maintainers.2002/msg00003.html

Have fun,
Tom


-- 
	T o m  M i t c h e l l 
	Just say no to 74LS73 in 2004



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux