Boost logo

Boost Users :

From: Da Xu (djsignal7_at_[hidden])
Date: 2020-03-02 19:37:16


 Thank you guys. Yah, the problem is that the pieces I am writing are all DLLs. And of course, gcc DLL and Msvc DLLs aren't compatible. Therefore, I HAVE to use two compilers. 
So, clang might produce data structure layout that might be compatible with gcc? 
One idea I thought about was to forgo data structures entirely. Allocate multiple pieces of named shared memory to hold basic data types. It would would be a book keeping nightmare though. And I am not entirely sure how to deal with mutex locking etc in that case. I don't think standard c++ mutex would work for shared memory...

What do u guys think?
Thank you!

    On Monday, March 2, 2020, 09:01:59 AM EST, degski via Boost-users <boost-users_at_[hidden]> wrote:
 
 
On Mon, 2 Mar 2020 at 02:11, Stian Zeljko Vrba via Boost-users <boost-users_at_[hidden]> wrote:

It seems that Boost has different binary layouts of its data structures when compiled with MSVC and MINGW, i.e., they’re not compatible between the two compilers.

Erm, gcc and vc will never output the same binary code, I haven't done or seen this, but it must be possible to compile clang (with mingw-gcc) for use with mingw, then with that clang-cl you might stand a chance. Sticking to static libraries, helps already (with exceptions across library boundaries), using C as glue could fix the issue forever.
Another, much simpler solution is to ditch mingw and use clang-cl as your main (or support to VC) compiler. Clang can 'theoretically' compile 'anything' (bar bugs in Clang), as long as it's coded in a std that's supported by that version of clang and the code adheres to that std, including but not limited to gcc-extensions and microsoft-extensions (in addition to clang-extensions). Contrary to what Clang claims, Clang is not fast (!!!), but it generates good code and excellent (short) error messages, sometimes better (faster binary) than VC, sometimes worse than VC, it's a crap-shoot, for speed-critical code, compiling bits with VC and bits with Clang after having identified which bits work best which compiler after bench-marking, gives to absolute best result, at least at par with gcc if not better.
 

-- 
@systemdeg"We value your privacy, click here!" Sod off! - degski
"Anyone who believes that exponential growth can go on forever in a finite world is either a madman or an economist" - Kenneth E. Boulding"Growth for the sake of growth is the ideology of the cancer cell" - Edward P. Abbey
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
  


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net