• Lucid Dreaming - Dream Views




    Results 1 to 9 of 9

    Hybrid View

    1. #1
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935

      Tell me everything about DLLs

      I do most of my programming on the Mac so I've never made a dll before. My boss wants me to write a parser for a scripting language that we use internally and make it into a dll so that everyone else can use the same one.

      I write in GNU C++ and C, it's important that it has to be GNU so that I can reuse the code to make a Mac resource too.

      How do DLLs work (from a developer standpoint)? Is it up to the dll or the application using it to create a thread for it for it? Is there something special that I have to do so that I can have headers in different language? I'm the only one in the company using C++, most everyone else uses Javascript, Visual Basic, Python, or Java.

    2. #2
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      DLL's are very similar in concept to *nix shared objects
      just a bunch of functions / objects accessible through outward facing symbols

      MinGW is what you need
      stands for Minimalist GNU for Windows
      and it's the GCC + associated build utils ported to Windows

      Get yourself a MinGW cross compiler for your platform, and you'll be able to compile native Windows code from Mac or Linux

      there's plenty of documentation around covering cross-compiling
      (\_ _/)
      (='.'=)
      (")_(")

    3. #3
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      I have mingw on my PC at work, I'll load it up on my Mac since XCode is the best IDE anyway. I didn't know that I could cross compile from the Mac for Windows... does it still perform the multipass optimization?

    4. #4
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      AFAIK cross-compiling with MinGW produces identical results as native compiling
      (\_ _/)
      (='.'=)
      (")_(")

    5. #5
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Beautiful, I can get rid of that go-awful PC at my workstation.

      Dev-C++ and Visual Studios are nice, but it like a little toy compared to XCode.

    6. #6
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      installing mingw will give you a windows specific version of all the GCC compilers and utilities

      Your native GCC would be

      Code:
      gcc -o c-prog c-prog.c
      g++ -o cpp-prog cpp-prog.cpp
      and for Win32 cross-compiling
      I forget what the naming convention is exactly, but it's something like

      Code:
      mingw-gcc-win32 -o c-prog c-prog.c
      mingw-g++-win32 -o cpp-prog cpp-prog.cpp
      If you use windows specific things
      (like using native windows threads, instead of using posix threads)
      you will also need the mingw runtime
      this is just a small DLL

      If you code windows specific things into your code, any compiled code will depend (and be dynamically linked to) the runtime

      but to be honest, everyone uses pthreads anyways....
      (\_ _/)
      (='.'=)
      (")_(")

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •