Topic
  • 10 replies
  • Latest Post - ‏2015-04-10T18:22:03Z by jfran_florez
icemanx
icemanx
5 Posts

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
    311 Posts
    ACCEPTED ANSWER

    Re: C++ cross compiling on windows?

    ‏2013-07-04T09:18:26Z  

    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.

  • Yevo
    Yevo
    280 Posts
    ACCEPTED ANSWER

    Re: C++ cross compiling on windows?

    ‏2013-07-10T09:32:11Z  
    • icemanx
    • ‏2013-07-10T07:41:23Z

    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.

    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.

  • Yevo
    Yevo
    280 Posts
    ACCEPTED ANSWER

    Re: C++ cross compiling on windows?

    ‏2013-07-21T14:59:20Z  
    • icemanx
    • ‏2013-07-21T08:24:31Z

    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! 

    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.

  • shanz9903
    shanz9903
    311 Posts

    Re: C++ cross compiling on windows?

    ‏2013-07-04T09:18:26Z  

    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

    Re: C++ cross compiling on windows?

    ‏2013-07-04T15:11:15Z  
    • shanz9903
    • ‏2013-07-04T09:18:26Z

    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.

    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

    Re: C++ cross compiling on windows?

    ‏2013-07-04T18:17:32Z  

    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
    280 Posts

    Re: C++ cross compiling on windows?

    ‏2013-07-06T18:06:10Z  

    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

    Re: C++ cross compiling on windows?

    ‏2013-07-10T07:41:23Z  
    • Yevo
    • ‏2013-07-06T18:06:10Z

    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.

    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
    280 Posts

    Re: C++ cross compiling on windows?

    ‏2013-07-10T09:32:11Z  
    • icemanx
    • ‏2013-07-10T07:41:23Z

    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.

    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

    Re: C++ cross compiling on windows?

    ‏2013-07-21T08:24:31Z  
    • Yevo
    • ‏2013-07-10T09:32:11Z

    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.

    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
    280 Posts

    Re: C++ cross compiling on windows?

    ‏2013-07-21T14:59:20Z  
    • icemanx
    • ‏2013-07-21T08:24:31Z

    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! 

    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

    Re: C++ cross compiling on windows?

    ‏2013-07-21T17:05:20Z  
    • Yevo
    • ‏2013-07-21T14:59:20Z

    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.

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

  • jfran_florez
    jfran_florez
    10 Posts

    Re: C++ cross compiling on windows?

    ‏2015-04-10T18:22:03Z  
    • icemanx
    • ‏2013-07-21T17:05:20Z

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

    Hi icemanx,

     

    could you  explain in detail how you achieved this. I am interested in developibg rhapsody models in windowa that would rub on a rhaspberry pi, abd I think what you have done is exactly what I need

    thanks