CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Location
    U.S. Texas
    Posts
    0

    Code::Blocks C++ static linking

    In a nutshell: How can I statically link .dll files into my programs executable? I know it's possible, just have never done it before. I know there is also some issues that arise in doing so ( as well as bloating the executable's size ) but I'm still game for it.

    Also, if that is just way to problematic, could someone at least tell me a way to link to the .dll files I need without having them directly in the same directory as the .exe file? The only reason I'm wanting to either statically link or organize these files is that there are several very small .dll files that I'm using, and I don't want the user to have to look at the directory where the .exe is and have to skim through ( a bit exaggerated ) 30 .dll files just to find the executable. It's also good to separate the files.

    Any help would be great! I've been trying to use several other compilers and IDE's lately for exposure purposes ( I've also been doing Command line/Shell compiling/linking lately for those same reasons ).

  2. #2
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Code::Blocks C++ static linking

    The way is Resource Binding.

    Find VC++ forum old posts you will get it.
    ◄◄ hypheni ►►

  3. #3
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Code::Blocks C++ static linking

    Regarding the linking part I think this sorts it all out http://www.network-theory.co.uk/docs...cintro_25.html

    When you have the dlls in another dir than the exe see this http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx that explains windows search order for dlls.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured