3

My c++ project is using TIBCO's TIBRV library (namely libtibrv.lib, libtibrvcpp.lib), TIBRV x64 version files were compiled by vs10, previously my project was compiled in VS2013 and everything is fine.

Now, when I upgrade my project to VS2017, an LNK2001 error is triggered saying "unresolved external symbol __iob_func referenced ", this is due to Microsoft changed its CRT pathes and libraries (see https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/ ) since VS 2015.

However, as there is no maintenance agreement anymore, TIBCO wouldn't provide a x64 TIBRV version compiled in VS2017.

Hence I wonder, is there a way to wrap the TIBRV x64 library files (libtibrv.lib, libtibrvcpp.lib) compiled under VS10, in VS2013, then called from VS2017? How to do that?

athos
  • 6,120
  • 5
  • 51
  • 95
  • Don't think possible, but vc2015 and vc2017 libraries are binary compatible. So future is bright. – seccpur May 03 '18 at 01:35
  • @seccpur it’s not bright... old lib can’t compile in vs2015+ – athos May 03 '18 at 01:36
  • According to [this](https://docs.tibco.com/pub/rendezvous/8.3.1_january_2011/pdf/tib_rv_cpp_reference.pdf), libtibrvcppmd.lib and libtibrvmd.lib are linked dynamically to the standard library. If the conditions are right, there's a chance that you might at least clear the CRT error by using those. – Jack C. May 03 '18 at 01:40
  • @JackC. but we compile as "MT" – athos May 03 '18 at 01:50
  • Yes, you would have to switch to /MD. I don't know if that's really hard or not. – Jack C. May 03 '18 at 03:18
  • You could perhaps write a wrapper that exports the functionality you want and then compile it as a DLL under VS 2013. Sounds like a lot of work though, and you might be limited to a C API. – Paul Sanders May 03 '18 at 05:36
  • @PaulSanders if there's no other way then this is the only way.. is there an example of doing so? – athos May 03 '18 at 08:01
  • @JackC. have you tried recompile the tibrv source? – athos May 03 '18 at 08:39
  • @athos I don't have an example for you, sorry. Learn how to write a DLL, exporting C functions or C++ classes and you should be on your way. You can always wrap a C++ class in C by passing `this` around as a `void *` but if you're lucky VS2013 and VS2017 will share the same C++ ABI. Maybe someone on SO knows if that's true or not. – Paul Sanders May 03 '18 at 23:08
  • @athos I have not tried to recompile. The same manual states that source code for the C++ component is provided to allow users to recompile. Also, you might be able to clear the __iob_func warning specifically by linking to "legacy_stdio_definitions.lib". – Jack C. May 04 '18 at 00:29
  • found [something](https://stackoverflow.com/questions/30412951/unresolved-external-symbol-imp-fprintf-and-imp-iob-func-sdl2#comment55259862_30894349) might be a solution. – athos May 04 '18 at 04:16

0 Answers0