Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-23 Thread John Emmas via cfe-users
Many thanks Dave, Over on llvm-dev a contributer called Hans found this on Microsoft's MSDN site:- https://docs.microsoft.com/en-us/cpp/cpp/defining-inline-cpp-functions-with-dllexport-and-dllimport So the current theory is that Microsoft's compiler can indeed inline DLL functions - but

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-23 Thread John Emmas via cfe-users
On 22/09/2021 18:21, Reid Kleckner via cfe-users wrote: Looking back in the thread, I found the example code, and I see that MSVC refuses to inline this helper, but clang will inline it. I believe clang is permitted to inline it, MSVC will export the static data member (_the_keyboard), so

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-22 Thread John Emmas via cfe-users
On 21/09/2021 14:24, John Emmas via cfe-users wrote: clang-cl /? reveals that it'll handle the Microsoft variant of /Ob0 [...] So do you happen to know if clang-cl produces some kinda log file (i.e. that'd let me see which commands it actually received?) All the signs here are that Clang

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread John Emmas via cfe-users
I just found something else which might be significant... I noticed that when linking this exe, I had a linker option enabled called /FORCE:MULTIPLE If I remove that option, the Clang linker then gives me a list of about a dozen duplicated symbols. And with that option I get a similarly

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread John Emmas via cfe-users
On 21/09/2021 13:49, Jeffrey Walton wrote: The U option is -fno-inline. But I think Clang has an option to consume MSVC style options, so you may be able to use /Ob. I think you can check which MSVC style options Clang accepts with 'clang-cl /?' or 'clang-cl -?'. Thanks again Jeff and

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-21 Thread John Emmas via cfe-users
Many thanks Jeff & David, Overnight I remembered that Visual Studio itself offers a specific option to disable inline function expansion. For MSVC itself, this gets done by setting a compiler option called "/Ob" ("/Ob0" indicates disabled). If "/Ob0" isn't specified at compile time,

Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

2021-09-20 Thread John Emmas via cfe-users
On 20/09/2021 12:36, John Emmas via cfe-users wrote: But if I switch VS2019 to use Clang (when building the EXE) Clang's linker will complain that it can't find the variable 'revision_num'. But of course, 'revision_num' is an internal variable that's private to the DLL [...] - so

Re: [cfe-users] Building with Clang (on Windows) - but for Linux

2020-08-26 Thread John Emmas via cfe-users
Many thanks guys !! ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Re: [cfe-users] Building with Clang (on Windows) - but for Linux

2020-08-26 Thread John Emmas via cfe-users
On 25/08/2020 17:51, Csaba Raduly wrote: You can debug programs created by clang with gdb (which you already installed). Clang has its own debugger (called lldb). It's packaged separately and you can install it with sudo apt-get install lldb (You can also debug programs created with g++

[cfe-users] Building with Clang (on Windows) - but for Linux

2020-08-25 Thread John Emmas via cfe-users
Sorry about the confusing subject line!! I use Visual Studio 2019 on Windows 10 and I've just installed something called WSL (Windows Subsystem for Linux) which allows it to build apps for Linux. A big part of this involves installing a Linux distro and I've chosen Debian (mostly it just

Re: [cfe-users] Compiling for Linux (with Visual Studio and Clang)

2020-08-10 Thread John Emmas via cfe-users
Thanks Paul - I found some instructions for installing WSL and Linux here:- https://docs.microsoft.com/en-us/windows/wsl/install-win10 and I've managed to get it all installed without any problems - but I can't seem to run it :-( Basically... it needs me to use Windows PowerShell to enable

Re: [cfe-users] Compiling for Linux (with Visual Studio and Clang)

2020-08-08 Thread John Emmas via cfe-users
On 08/08/2020 13:47, Aaron Ballman wrote: Unfortunately, I don't have any experience in this area and I don't know anyone who's tried that. It seems like it should be plausible, but you may be breaking new ground. Haha - story of my life... ;) I did a bit more digging and AFAICT Visual

Re: [cfe-users] Compiling for Linux (with Visual Studio and Clang)

2020-08-08 Thread John Emmas via cfe-users
On 08/08/2020 10:14, Eric Christopher wrote: There are directions for discord and irc in the left hand panel on llvm.org :) Got it - thanks ! ___ cfe-users mailing list cfe-users@lists.llvm.org

Re: [cfe-users] Compiling for Linux (with Visual Studio and Clang)

2020-08-08 Thread John Emmas via cfe-users
On 08/08/2020 08:07, Harry Wagstaff wrote: You might have more luck asking on a visual studio forum since it seems vs-specific. I think a lot of people cross-developing for Linux are now using WSL, and VS Code has good support for this but I'm not sure about Visual Studio itself. On

Re: [cfe-users] Compiling for Linux (with Visual Studio and Clang)

2020-08-08 Thread John Emmas via cfe-users
On 04/08/2020 14:46, John Emmas wrote: I read somewhere that the clang devs and Microsoft were collaborating to make Visual Studio compatible with clang. So what's the situation if I want to compile some C++ code for Linux? [...] Is there a Linux version of Visual Studio available now? Or

[cfe-users] Compiling for Linux (with Visual Studio and Clang)

2020-08-04 Thread John Emmas via cfe-users
Hi there... back in 2019 I read somewhere that the clang devs and Microsoft were collaborating to make Visual Studio compatible with clang. IIRC the goal was to be able to use Visual Studio to build programs for both Windows and Linux. I tested Visual Studio with clang (on Windows) and I