1

I would like to port an existing Linux application from its plain C/C++ source code to Windows XP/Vista/7 exactly same functionality to have, without losing few modules here and there etc. Basic codes are fine to build, but problem is the application I will be porting have other Linux dependencies.

Question: How can I port a C/C++ code which has other libraries dependencies, to Windows system? Using MinGW. Is there any IDE where I can do that? Or first of all I need to find out dependent libraries. And then finally build the main application?

Would it be possible to advise, a hello world for such application or reference to any resource which really works. Because I tried myself and i get fail building the other dependencies it has using MinGW. Follow up:

  1. installing Cygwin

    1. http://cygwin.com/setup.exe
    2. C:/cygwin
    3. make sure checked all gcc/g++/svn/wget etc...
  2. install apt-cyg (good if it was default)

    wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
    install apt-cyg /bin
    
  3. figured out that, this are related libraries for your apps

    apt-cyg install libxml2 iconv bison flex pkg-config
    
  4. install Linux apps to Windows apps

    wget site/download/staffs
    tar xvfz staffs.tar.gz # your time saver apps
    ./configure
    make
    make install
    

2 Answers 2

2

MinGW is, by nature, minimalist; it tries hard not to bring any baggage with it. It sounds like you actually want baggage, in which case rather than using MinGW you should be using Cygwin, which emulates/implements many UNIX system calls and libraries on Windows. The whole GNU toolchain is there, and many times you can just run ./configure and make and everything works fine.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, i started your advise, and will update above my follow up. Hope i get success.
It works! but the build that i prepare, how can i copy this setup to keep it for future? Without re-inventing this whole procedure?
When we build apps using CygWin does it create any DLL files? or Any references to later reuse. Or it is done by MinGW? I have updates above. Thanks.
0

Running on an emulation layer (a good suggestion) will get you going quickly, but it will be sub-optimal.

Depending on your performance requirements, you may have to retool the app to replace the Linux-dependent code with either portable alternatives such as Boost or other portable library code, or Windows-specific replacement code of your own.

1 Comment

Yes for performence tips you are very correct, i can see while building and installing its very slow, they main goal for this is to learn how it works. And after seeing a face of success, i will optimize it. I prefer seeing first and doing it. thanks, i just update with working update!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.