CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Join Date
    Jul 2017
    Location
    Greece
    Posts
    130

    Re: Dynamic Library: Do you need to export variables of a class?

    Quote Originally Posted by 2kaud View Post
    and why the dll interfaces need to be 'C' and not C++!
    Well if I'm compiling the project myself, I won't probably have any problems but if others need to compile it in other operating systems too , from what i read from your links i will have a problem. If i program every dll in C i won't have problems with the compilers right?

  2. #17
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,824

    Re: Dynamic Library: Do you need to export variables of a class?

    If the .exe(s) and the .dll(s) are compiled with exactly the same version of the compiler/stl etc then there shouldn't be a problem. If an .exe or another .dll is compiled with say version w.x.y and this .dll is compiled with version w.x.z then yes, you could well have a problem. If you are distributing .dll(s) as upgrades to big projects you need to have the .dll(s) interfaces as 'C' so that it doesn't matter if the version of the compiler/stl that was used to compile the .dll is not the same as that used to compile the .exe(s).
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #18
    Join Date
    Jul 2017
    Location
    Greece
    Posts
    130

    Re: Dynamic Library: Do you need to export variables of a class?

    Now I know everything I need to know! You really helped me all of you. I never expected that dlls would have to much you need to know. A last question. Does the same things are applied to linux shared libraries? Should I search more about it?

  4. #19
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,824

    Re: Dynamic Library: Do you need to export variables of a class?

    Sorry - I can't help you with Linux as I only use Windows/MSVS.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

Page 2 of 2 FirstFirst 12

Tags for this Thread

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