Topic
9 replies Latest Post - ‏2013-07-21T17:05:20Z by icemanx
icemanx
icemanx
5 Posts
ACCEPTED ANSWER

Pinned topic C++ cross compiling on windows?

‏2013-07-03T10:01:23Z |

Hello,

 

I'm trying to cross compile arm-linux in windows platform. Is there any guide for it? I succesfully cross-compile simple cpp programs in cygwin, so my compiler is installed.

 

Thank you for your answers.

  • shanz9903
    shanz9903
    268 Posts
    ACCEPTED ANSWER

    Re: C++ cross compiling on windows?

    ‏2013-07-04T09:18:26Z  in response to icemanx

    No idea but you could try doing it yourself.

    You'd need to concentrate on certain properties such as CPP_CG::Cygwin::

    MakeFileContent
    InvokeMake
    CCCompileCommand
    CompileCommand
    CompileFlags
    CPPCompileCommand
    CPPCompileDebug
    CPPCompileRelease
    CPPCompileSwitches

    I would make my changes, then regenerate and view the makefile (even diff it with the previous version).

    Surely someone else has done it!  Not me though.  I use ARM with Windows CE which is supported out of the box.

    • icemanx
      icemanx
      5 Posts
      ACCEPTED ANSWER

      Re: C++ cross compiling on windows?

      ‏2013-07-04T15:11:15Z  in response to shanz9903

      Thank you for your answer. I'll concentrate them ant try to make it work. While I'm doing this maybe someone who work with ARM linux, share his/her experiments.

  • Роман_Самойленко
    7 Posts
    ACCEPTED ANSWER

    Re: C++ cross compiling on windows?

    ‏2013-07-04T18:17:32Z  in response to icemanx

    I'm developing on QT libraries 4.8.4 using Rhapsody and RTC. But you need to set IDE for QT (QT not supporting IBM). All of this settings I'll write later.

  • Yevo
    Yevo
    278 Posts
    ACCEPTED ANSWER

    Re: C++ cross compiling on windows?

    ‏2013-07-06T18:06:10Z  in response to icemanx

    Hi, since your target is Linux, I'd recommend you to use Linux environment as a basis for customization. You should also create your own make files for framework libraries build, which can be also implemented using existing make files for Linux adapters.

    Of course, there is a chance that some Cygwin settings may be used as well.

    Updated on 2013-07-06T18:07:31Z at 2013-07-06T18:07:31Z by Yevo
    • icemanx
      icemanx
      5 Posts
      ACCEPTED ANSWER

      Re: C++ cross compiling on windows?

      ‏2013-07-10T07:41:23Z  in response to Yevo

      OK. I'll change my environment to "linux". As i understand, firstly i need to rebuild framework for my target processor. I'm going to work on this. Thank you for your answer.

      • Yevo
        Yevo
        278 Posts
        ACCEPTED ANSWER

        Re: C++ cross compiling on windows?

        ‏2013-07-10T09:32:11Z  in response to icemanx

        It is not so simple. You should use Linux adapter (linuxos.cpp, linuxos.h files and osconfig\Linux\omosconfig.h files).

        But since you are going to compile framework on host machine, you should prepare .mak files for framework compilation according to syntax, which is used in your cross compiler and make.

        Existing linuxXXX.mak files are designated for framework build directly on Linux machine.

        If your cross compiler and whole cross compilation environment are similar to Cygwin, then you should "merge" CygwinXXX.mak and linuxXXX.mak file in order to use Linux adapter files with your cross compiler and make.

         

        For example, cygwinoxf.mak file contains "compilation command " of NTOS.cpp file. You should replace it with linuxos.cpp. Moreover, header path points to osconfig\Cygwin directory. It should be replaced to use osconfig\Linux directory.

        Probably, there are more things to customize: names of system libraries, which should be linked with application, etc.

        • icemanx
          icemanx
          5 Posts
          ACCEPTED ANSWER

          Re: C++ cross compiling on windows?

          ‏2013-07-21T08:24:31Z  in response to Yevo

          Hello Yevo,

           

          I'm succesfully compile and run my programs now. It's not hard work but it takes time.I write my own run and make bat files. I have last thing to ask, In my run.bat file, how can i pass arguments from rhapsody? I'm uploading code to my device via "scp" and run it via "ssh". But if I can pass Device's IP adress argument ,it will be very easy to work.

           

          Thanks! 

          • Yevo
            Yevo
            278 Posts
            ACCEPTED ANSWER

            Re: C++ cross compiling on windows?

            ‏2013-07-21T14:59:20Z  in response to icemanx

            1) fill in <your environment>::RemoteHost property with IP of your host.

            2) add $RemoteHost to <your environment>::InvokeExecutable as a parameter of your run.bat file

            That is all.

            • icemanx
              icemanx
              5 Posts
              ACCEPTED ANSWER

              Re: C++ cross compiling on windows?

              ‏2013-07-21T17:05:20Z  in response to Yevo

              Thank you very much for your help Yevo! Now I have a strong development environment for ARM-Linux platform.