Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. regarding static library

regarding static library

Scheduled Pinned Locked Moved C / C++ / MFC
linuxquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a mulay
    wrote on last edited by
    #1

    Is there a way to build a static library that could be used on both Windows & linux OS?

    N C 2 Replies Last reply
    0
    • A a mulay

      Is there a way to build a static library that could be used on both Windows & linux OS?

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      you mean something like ACE[^] library?

      nave

      A 1 Reply Last reply
      0
      • N Naveen

        you mean something like ACE[^] library?

        nave

        A Offline
        A Offline
        a mulay
        wrote on last edited by
        #3

        not exactly !

        1 Reply Last reply
        0
        • A a mulay

          Is there a way to build a static library that could be used on both Windows & linux OS?

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          No, the way it is done generally is that the same code is compiled with two different compilers: one for windows (and it produces a .lib file) and one for linux (it produces an .a file if I remember correctly). You cannot use the same library under windows and linux, because a library contains object code which is not portable.


          Cédric Moonen Software developer
          Charting control [v1.2]

          A 1 Reply Last reply
          0
          • C Cedric Moonen

            No, the way it is done generally is that the same code is compiled with two different compilers: one for windows (and it produces a .lib file) and one for linux (it produces an .a file if I remember correctly). You cannot use the same library under windows and linux, because a library contains object code which is not portable.


            Cédric Moonen Software developer
            Charting control [v1.2]

            A Offline
            A Offline
            a mulay
            wrote on last edited by
            #5

            Thanks for the quick reply Cédric. [:)]

            C 1 Reply Last reply
            0
            • A a mulay

              Thanks for the quick reply Cédric. [:)]

              C Offline
              C Offline
              Cedric Moonen
              wrote on last edited by
              #6

              You're welcome. BTW, if you want to compile both for windows and linux (the way I described in my first answer), your code shouldn't use any platform dependant API (like MFC or WIN32 API). But cross-platform solutions exist, like for example ACE (as already said by Naveen) or wxWidgets[^] (something very similar to MFC but cross-platform).


              Cédric Moonen Software developer
              Charting control [v1.2]

              A 1 Reply Last reply
              0
              • C Cedric Moonen

                You're welcome. BTW, if you want to compile both for windows and linux (the way I described in my first answer), your code shouldn't use any platform dependant API (like MFC or WIN32 API). But cross-platform solutions exist, like for example ACE (as already said by Naveen) or wxWidgets[^] (something very similar to MFC but cross-platform).


                Cédric Moonen Software developer
                Charting control [v1.2]

                A Offline
                A Offline
                a mulay
                wrote on last edited by
                #7

                Yes Cedric, I have taken care not to include any platform dependent code inside the code. Now I just need to build and link the code to diffenent runtimes on respective platforms.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups