aws-sdk-cpp
aws-sdk-cpp copied to clipboard
Warnings when linking, executable crashing on launch
Confirm by changing [ ] to [x] below:
- [x ] I've gone though Developer Guide and API reference
- [x ] I've searched for previous similar issues and didn't find any solution
Platform/OS/Hardware/Device Windows 10 x64
Describe the question I'm using scons to link the libs to godot game engine. I get warnings that I believe are causing my executable to crash at launch, this is the warning: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-warning-lnk4217?view=msvc-170
The build itself apparently doesn't fail, but something is going wrong. If I remove the modules that conflict with AWS, more modules start to complain about conflicts. It seems to always be the same bit of code, though I could be reading the warning incorrectly...
// aws\core\utils\memory\stl\AWSStreamFwd.h
...
// Serves no purpose other than to help my conversion process
typedef std::basic_ifstream< char, std::char_traits< char > > IFStream;
typedef std::basic_ofstream< char, std::char_traits< char > > OFStream;
typedef std::basic_fstream< char, std::char_traits< char > > FStream; // <---- This line here?
typedef std::basic_istream< char, std::char_traits< char > > IStream;
typedef std::basic_ostream< char, std::char_traits< char > > OStream;
typedef std::basic_iostream< char, std::char_traits< char > > IOStream;
typedef std::istreambuf_iterator< char, std::char_traits< char > > IStreamBufIterator;
Logs/output Here's some example warnings from when I build godot with the libraries linked. If I remove the godot modules that cause these warnings, more warnings popup for other modules.
Creating library bin\godot.windows.opt.tools.64.lib and object bin\godot.windows.opt.tools.64.exp
LINK : warning LNK4217: symbol
'??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ (public: virtual __cdecl std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void))'
defined in
'module_vhacd.windows.opt.tools.64.lib(VHACD.windows.opt.tools.64.obj)'
is imported by
'module_s3.windows.opt.tools.64.lib(s3.windows.opt.tools.64.obj)'
in function
'"int `public: __cdecl std::basic_fstream<char,struct std::char_traits<char> >::basic_fstream<char,struct std::char_traits<char> >(char const *,int,int)'::`1'::dtor$0" (?dtor$0@?0???0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z@4HA)'
LINK : warning LNK4217: symbol
'?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z (public: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool))'
defined in
'module_vhacd.windows.opt.tools.64.lib(VHACD.windows.opt.tools.64.obj)'
is imported by
'module_s3.windows.opt.tools.64.lib(s3.windows.opt.tools.64.obj)'
in function
'"public: __cdecl std::basic_fstream<char,struct std::char_traits<char> >::basic_fstream<char,struct std::char_traits<char> >(char const *,int,int)" (??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z)'
LINK : warning LNK4217: symbol
'??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ (protected: __cdecl std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void))'
defined in
'module_vhacd.windows.opt.tools.64.lib(VHACD.windows.opt.tools.64.obj)'
is imported by
'module_s3.windows.opt.tools.64.lib(s3.windows.opt.tools.64.obj)'
in function
'"public: __cdecl std::basic_fstream<char,struct std::char_traits<char> >::basic_fstream<char,struct std::char_traits<char> >(char const *,int,int)" (??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z)'
LINK : warning LNK4217: symbol
'??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z (public: __cdecl std::basic_iostream<char,struct std::char_traits<char> >::basic_iostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *))'
defined in
'module_tinyexr.windows.opt.tools.64.lib(tinyexr.windows.opt.tools.64.obj)'
is imported by
'module_s3.windows.opt.tools.64.lib(s3.windows.opt.tools.64.obj)'
in function
'"public: __cdecl std::basic_fstream<char,struct std::char_traits<char> >::basic_fstream<char,struct std::char_traits<char> >(char const *,int,int)" (??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z)'
LINK : warning LNK4217: symbol
'??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ (public: virtual __cdecl std::basic_iostream<char,struct std::char_traits<char> >::~basic_iostream<char,struct std::char_traits<char> >(void))'
defined in
'module_tinyexr.windows.opt.tools.64.lib(tinyexr.windows.opt.tools.64.obj)'
is imported by
'module_s3.windows.opt.tools.64.lib(s3.windows.opt.tools.64.obj)'
in function
'"int `public: __cdecl std::basic_fstream<char,struct std::char_traits<char> >::basic_fstream<char,struct std::char_traits<char> >(char const *,int,int)'::`1'::dtor$1" (?dtor$1@?0???0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z@4HA)'
[100%] scons: done building targets.
[Time elapsed: 00:33:38.158]
Hi @MissingAFew , So I'm not familiar with the godot game engine and including 3rd party applications always complicates reproducing... I think a good first step here to see if there is something on the SDK side is, are you able to build, link and run a simple standalone app? (Let me know if you need an example on how to do that)
P.S.kind of a shot in the dark, but did you put the SDK dll files in the same folder as your executable?
Yes sir, I have linked these same libs with Unreal Engine 4. The libraries should be good. The conflict seems to be with the typedef? Im not really sure honestly.
I did try putting dll in there at one point, but it shouldnt have an effect because I am pretty sure I am statically linking.
Sorry, I double checked and I actually linked the dll with UE4 so its not the exact same. I am using the static libs for godot.
I would think that since the built dll are good, the libs would probably be built correctly as well. Do you have any suggestions? Could this be a namemangling issue with the modules?
Hi @MissingAFew , Sorry for the slow response, I'm just a bit lost on how to approach this... For now I will give it a shot to link the library to the engine but it'll probably take me a while to get there, in the mean time I think you're on the right path, it does look to me like name mangling I just don't know if it could have a simple solution or if it'd be a bigger feature to add/fix
Don't worry about addressing it too quickly, enjoy the holidays. I have a feeling it might be a significant change to the SDK, though hopefully not.
I appreciate the help, let me know if I can support in any way.
Just wanted to bump this since Im back in the office. Thanks again for taking a look at this, and I'll continue to look into it as well.
alright sorry for the delay, I'm back now... can I ask for a walk through on how you linked the SDK to the Godot Engine? That will make thigns much easier for me
I essentially followed the links below:
Engine Compilation: https://docs.godotengine.org/en/stable/development/compiling/compiling_for_windows.html#requirements
Creating Modules: https://docs.godotengine.org/en/stable/development/cpp/custom_modules_in_cpp.html
Linking Libraries to Modules: https://docs.godotengine.org/en/stable/development/cpp/binding_to_external_libraries.html
Summary of Requirements: SCons 3.1.1 VS 2019 Python 3.5+ Godot Engine Source: https://github.com/godotengine/godot
Let me know if you want me to zip up the module I made for linking the S3 libraries. But you may want to build your own S3 libs. These were the libs I was linking:
'aws-c-common.lib', 'aws-checksums.lib', 'aws-c-event-stream.lib', 'aws-cpp-sdk-core.lib', 'aws-cpp-sdk-dynamodb.lib', 'aws-cpp-sdk-kinesis.lib', 'aws-cpp-sdk-s3.lib', 'aws-cpp-sdk-transfer.lib'
Please let me know if you have specific questions or issues, the setup process for compiling everything was a bit cumbersome, at least for me personally.
Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.