Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC CE, linking cbsdk.dll, #include "cbhwlib.h" requires NO_AFX to be defined. #63

Closed
cboulay opened this issue Feb 13, 2017 · 2 comments

Comments

@cboulay
Copy link
Collaborator

cboulay commented Feb 13, 2017

I wrote an application that links to cbsdk and uses some of the types declared in cbhwlib.h. In MacOS it worked fine. In Windows it failed because it could not find some types used in function arguments defined in cbhwlib.h. This is because these types are only defined for non-Windows (here) or via #include <windows.h> if NO_AFX is defined (here).

I will create a stub in the Wiki for "How to use cbsdk" and put in this little bit of information for now, but I think a better solution is needed.

  • The STL has replacements for all the offending ALLCAPS types (e.g., UINT16 -> uint16_t).
  • In the provided .sln files, NO_AFX is defined by default, and it was defined in the CMakeLists.txt too (I wonder why @FlorianFranzen removed this in his fork?). Maybe <windows.h> should be included by default in Windows builds and not require a compiler definition.
  • As much as possible, it would be good to decouple cbsdk.h from cbhwlib.h so cbhwlib.h is no longer required.
    • cbSdkCCFEvent needs cbStateCCF from cbhwlib.h. This is just an enum and can be moved easily.
    • cbSdkCCF needs cbCCF. This is a complicated dependency to work around and any attempt to do so would need your guidance.
@dashesy
Copy link
Collaborator

dashesy commented Feb 16, 2017

Yes NO_AFX should be defined, to avoid bringing in some MFC stuff, from what I remember. This is because Blackrock's code uses same headers and it is using MFC.
Those CCF structs would be difficult to wrap, because they are something like fileds generated by protocol buffer with lots of fields. Can #ifdef them out for now, I am not sure if anyone uses that XML file (I wish I had not added XML, anything else is better!).

@cboulay
Copy link
Collaborator Author

cboulay commented Feb 20, 2017

Closed with #66

@cboulay cboulay closed this as completed Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants