Goutham
Goutham

Reputation: 2059

Recommendations for building a windows dll

I am trying to create a Windows dll out of a few visual c++ projects that I am working on. My larger goal is to create a dll that can be linked by clients without worrying(too much) about the nuances of how my dll was compiled.

I did structure my project such that classes are exported based on the ideas mentioned here: http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL

Upvotes: 1

Views: 229

Answers (2)

mox
mox

Reputation: 6324

Have a look at the Best Practices for Creating DLLs, this is basic stuff but often ignored issues that can lead to very ugly side effects.

Upvotes: 0

Manuel Amstutz
Manuel Amstutz

Reputation: 1388

Some point witch crosses my mind.

  1. Do not use stl objects in public method signatures or structs.
  2. If possible use only simple data types in your signatures.
  3. If you have to export some structs, define the packing in the header.

Upvotes: 1

Related Questions