jeog / TDAmeritradeAPI

Front-end library - with C, C++, Python, and Java interfaces - for the recently expanded TDAmeritrade API
GNU General Public License v3.0
238 stars 61 forks source link

build error on VS 2019 #19

Closed XsiBoss closed 4 years ago

XsiBoss commented 4 years ago

First of all, I'd like to thank you for all your effort and this good job! :) Yesterday I installed the latest VS2019 community edition and loaded vsbuild.sln and then build the projects in x64 environment. I got 40 errors and 349 warnings. All the error is C2593 'operator =' is ambiguous. Warnings are various. Mostly C4251 and C4996, which seem to not simply ignorable. Did I do something wrong or missing? Or is this a kind of compiler version problem? Since you haven't mentioned build error and warnings, it's supposed to be no issue with them. So I'm guessing there must be a quick solution for this.

Additional notes: The above numbers are for debug build. In release build, errors reduced to 29 and warnings are the same.

Addendum: If I change the C++ Language Standard from Default to C++17, all the error is gone. So the error seems to be C++ standard related problem. You mentioned it needs to support C++11, but there's no exact C++11 choice in VS2019 default install. So I assume C++17 is upward compatible with C++11 since it doesn't generate any compile error. (But the C++14 generates above error) I couldn't find a way to remove important warnings though. May I just ignore them? (Do you aware of those warnings and ignore them too?)

jeog commented 4 years ago

Ya, it seems to be some type of standard/toolset issue. Not quite sure why C++14 doesn't work but I tend to have issues like this w/ new versions of VS breaking older code.

Can you post an example of some of the different warnings. Things are a bit chaotic for me in NY right now so I'm not sure how much time I'll have to do a fix but I can let you know if the warnings will be an issue.

The other approach would be to manually set the toolset to v142.

XsiBoss commented 4 years ago

Oh, that means you don't see any warnings? I'm pasting here some of them:

1>C:\Users\Michael\Python_Proj\Data Loader\TDA\TDAmeritradeAPI-master\include\tdma_api_streaming.h(2164,37): warning C4251: 'tdma::StreamingSession::VERSION': class 'std::basic_string<char,std::char_traits,std::allocator>' needs to have dll-interface to be used by clients of class 'tdma::StreamingSession' 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\xstring(4471): message : see declaration of 'std::basic_string<char,std::char_traits,std::allocator>' 1>C:\Users\Michael\Python_Proj\Data Loader\TDA\TDAmeritradeAPI-master\include\tdma_api_streaming.h(2165,55): warning C4251: 'tdma::StreamingSession::MIN_TIMEOUT': class 'std::chrono::duration<int64,std::milli>' needs to have dll-interface to be used by clients of class 'tdma::StreamingSession' 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\chrono(470): message : see declaration of 'std::chrono::duration<int64,std::milli>'

1>C:\Users\Michael\Python_Proj\Data Loader\TDA\TDAmeritradeAPI-master\uWebSockets\Socket.h(26,35): warning C4275: non dll-interface struct 'uS::Poll' used as base for dll-interface struct 'uS::Socket' 1>C:\Users\Michael\Python_Proj\Data Loader\TDA\TDAmeritradeAPI-master\uWebSockets\Libuv.h(98): message : see declaration of 'uS::Poll' 1>C:\Users\Michael\Python_Proj\Data Loader\TDA\TDAmeritradeAPI-master\uWebSockets\Socket.h(26): message : see declaration of 'uS::Socket'

1>C:\Users\Michael\Python_Proj\Data Loader\TDA\TDAmeritradeAPI-master\uWebSockets\HTTPSocket.h(207,63): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

jeog commented 4 years ago

Those warning shouldn't be an issue.