Menu

Stupid Question

Help
2019-12-07
2019-12-18
  • Matthew Elmer

    Matthew Elmer - 2019-12-07

    Howdy all,

    I am not very knowledgeable about linux or operating systems or really anything software related in general. All I'm sorta good at is C++, which brings me to my question that you will all sigh and shake your heads at:

    How do I compile a 64-bit Windows application from C++ source files in Cygwin? I have all of the necessary packages installed, but I don't know the command. Thanks so much! Your help is much appreciated.

    -- Matthew

     

    Last edit: Matthew Elmer 2019-12-07
  • Matthew Elmer

    Matthew Elmer - 2019-12-07

    Update--I figured out the command:

    x86_64-w64-mingw32-g++
    

    However, I am given the following error when trying to run through the windows cmd:

    "the code execution cannot proceed because libstdc++-6.dll was not found. Reinstalling the program may fix this problem."

    Can anyone shed some light on this? What am I missing? Do you need more than a .exe to run a .exe? Even the most basic of knowledge would be helpful. Thanks so much!

     

    Last edit: Matthew Elmer 2019-12-07
    • Kai Tietz

      Kai Tietz - 2019-12-07

      Hey,

      The missing library is actually from compiler runtime. You might need to
      provide those libraries in search path of your application
      The other chance would be to link libraries static. You can achieve this by
      passing '-static' option. See for further information linker/compiler
      documentation.

      Hope that helps you
      Kai

      Matthew Elmer mcmuffin6o@users.sourceforge.net schrieb am Sa., 7. Dez.
      2019, 05:31:

      Update:--I figured out the command:

      x86_64-w64-mingw32-g++ -std=c++17 -Wall -o

      However, I am given the following error when trying to run through the
      windows cmd:

      "the code execution cannot proceed because libstdc++-6.dll was not found.
      Reinstalling the program may fix this problem."

      Can anyone shed some light on this? What am I missing? Do you need more
      than a .exe to run a .exe? Even the most basic of knowledge would be
      helpful. Thanks so much!


      Stupid Question
      https://sourceforge.net/p/mingw-w64/discussion/723798/thread/87051328c4/?limit=25#29ec


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/mingw-w64/discussion/723798/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Matthew Elmer

        Matthew Elmer - 2019-12-11

        Kai,

        Good news! Static linking seemed to work. Out of curiosity, could you maybe explain why? Also, how would I provide the missing library?

        Thanks so much!!

         
        • NightStrike

          NightStrike - 2019-12-11

          On Tue, Dec 10, 2019, 8:30 PM Matthew Elmer mcmuffin6o@users.sourceforge.net wrote:

          Kai,

          Good news! Static linking seemed to work. Out of curiosity, could you
          maybe explain why? Also, how would I provide the missing library?

          Thanks so much!!

          https://cs-fundamentals.com/tech-interview/c/difference-between-static-and-dynamic-linking.php

          You provide the dll to your users by copying it from your cygwin
          installation path and putting it in the same directory as the executable
          they need to run. Windows by default will look for dlls first in the
          directory of the exe, then in the directories specified in the PATH
          environment variable. Note that linux and other ordering systems have
          slightly different search mechanisms.

           
  • Matthew Elmer

    Matthew Elmer - 2019-12-18

    Thanks so much NightStrike, I appreciate the time you took to impart this knowledge upon me.

     

Log in to post a comment.