boost/rational.hpp and VS2019
I'm guessing this might be solvable by updating to a newer version of boost (currently I'm running ver 1.71.0) but before updating, I wondered if there might be something obvious that 'm missing.... I'm building with Visual Studio 2019 and I get a whole bunch of errors simply by adding this line to an empty source file:- #include "boost/rational.hpp" It seems to be the same 6 errors but at various different lines - i.e. these errors, over & over again:- Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(146,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(146,8): error C2146: syntax error: missing ';' before identifier '_mm_macc_ps' Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(147,20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(147,9): error C2146: syntax error: missing ';' before identifier '_mm_macc_pd' Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(148,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(148,1): error C2086: 'int __m128': redefinition I just wondered if this might ring a bell with someone? e.g. might there be some preprocesser #define that I should've defined? (or a #define that I shouldn't be defining...) Thanks for any suggestions, John
On 8/16/2021 10:32 AM, John Emmas via Boost-users wrote:
I'm guessing this might be solvable by updating to a newer version of boost (currently I'm running ver 1.71.0) but before updating, I wondered if there might be something obvious that 'm missing....
I'm building with Visual Studio 2019 and I get a whole bunch of errors simply by adding this line to an empty source file:-
#include "boost/rational.hpp"
It seems to be the same 6 errors but at various different lines - i.e. these errors, over & over again:-
Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(146,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(146,8): error C2146: syntax error: missing ';' before identifier '_mm_macc_ps' Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(147,20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(147,9): error C2146: syntax error: missing ';' before identifier '_mm_macc_pd' Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(148,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(148,1): error C2086: 'int __m128': redefinition
I just wondered if this might ring a bell with someone? e.g. might there be some preprocesser #define that I should've defined? (or a #define that I shouldn't be defining...)
Thanks for any suggestions, John #include "boost/rational.hpp"
int main() { return 0; } The above code compiled against VS2019 gives no errors.
What architecture are you building for?
These intrinsic headers come from boost/integer/common_factor_rt.hpp and:
#if ((defined(BOOST_MSVC) && (BOOST_MSVC >= 1600)) ||
(defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) &&
defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64))
#include
I'm guessing this might be solvable by updating to a newer version of boost (currently I'm running ver 1.71.0) but before updating, I wondered if there might be something obvious that 'm missing....
I'm building with Visual Studio 2019 and I get a whole bunch of errors simply by adding this line to an empty source file:-
#include "boost/rational.hpp"
It seems to be the same 6 errors but at various different lines - i.e. these errors, over & over again:-
Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(146,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(146,8): error C2146: syntax error: missing ';' before identifier '_mm_macc_ps' Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(147,20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(147,9): error C2146: syntax error: missing ';' before identifier '_mm_macc_pd' Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(148,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ammintrin.h(148,1): error C2086: 'int __m128': redefinition
I just wondered if this might ring a bell with someone? e.g. might there be some preprocesser #define that I should've defined? (or a #define that I shouldn't be defining...)
Thanks for any suggestions, John _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
On 16/08/2021 18:57, John Maddock via Boost-users wrote:
What architecture are you building for?
These intrinsic headers come from boost/integer/common_factor_rt.hpp and:
[...]
I'm wondering if the check for x86 needs to be applied to the BOOST_MSVC check as well as the intel one?
Hi John - my builds are all for Windows/Intel and I'm using the MSVC compiler itself. Interestingly, I don't see the errors if I switch VS2019 to use the Clang compiler... This morning I removed all my own preprocessor directives and I've tried building for 32bit / 64bit / simple console app target / dll target. But as long as I build using MSVC I get the same error list in every case - just from #including that 1 x file!! Edward - I know it's a cheeky request but is there any way you could let me have your VS2019 project? If yours builds okay, then it must be something in my project settings. But if yours doesn't build either, then it's most likely a versioning problem here. I'm currently running VS2019 Community Edition, ver 16.11.0 - and my boost version is at 1.71.0 John
On 8/17/2021 4:43 AM, John Emmas via Boost-users wrote:
On 16/08/2021 18:57, John Maddock via Boost-users wrote:
What architecture are you building for?
These intrinsic headers come from boost/integer/common_factor_rt.hpp and:
[...]
I'm wondering if the check for x86 needs to be applied to the BOOST_MSVC check as well as the intel one?
Hi John - my builds are all for Windows/Intel and I'm using the MSVC compiler itself. Interestingly, I don't see the errors if I switch VS2019 to use the Clang compiler...
This morning I removed all my own preprocessor directives and I've tried building for 32bit / 64bit / simple console app target / dll target. But as long as I build using MSVC I get the same error list in every case - just from #including that 1 x file!!
Edward - I know it's a cheeky request but is there any way you could let me have your VS2019 project? If yours builds okay, then it must be something in my project settings. But if yours doesn't build either, then it's most likely a versioning problem here. I'm currently running VS2019 Community Edition, ver 16.11.0 - and my boost version is at 1.71.0
I ran my test from the command line with bjam using the latest source from Boost on the developer branch. The command line is: cl /Zm800 -nologo "test_include_rational.cpp" -Fo"test_include_rational.obj" -TP /wd4675 /EHs /GR /Zc:throwingNew /Zc:__cplusplus /bigobj /Z7 /Od /Ob0 /W4 /MDd /Zc:forScope /Zc:wchar_t /Zc:inline /favor:blend -c -DBOOST_ALL_NO_LIB=1 "-I..\..\.."
On 17/08/2021 18:23, Edward Diener via Boost-users wrote:
I ran my test from the command line with bjam using the latest source from Boost on the developer branch. The command line is:
cl /Zm800 -nologo "test_include_rational.cpp" -Fo"test_include_rational.obj" -TP /wd4675 /EHs /GR /Zc:throwingNew /Zc:__cplusplus /bigobj /Z7 /Od /Ob0 /W4 /MDd /Zc:forScope /Zc:wchar_t /Zc:inline /favor:blend -c -DBOOST_ALL_NO_LIB=1 "-I..\..\.."
Hi Edward - I ran the same command here (substituting my own file names) and it gives me the exact same error list. It doesn't get me any further but in some ways, I guess that's a good sign. I'm still on boost v1.71 but I think the rest of the team are on 1.74 - so I'll update to 1.74 later and see what happens. Thanks, John
Groan... life is never simple... On 18/08/2021 08:04, John Emmas wrote:
I think the rest of the team are on 1.74 - so I'll update to 1.74 later and see what happens.
I visited the libboost download page but no matter which version I try to download I just get directed to a weird page saying "JFrog" which won't let me go any further :-( Anyone know what's happening here? I've tried with Microsoft Edge and even the old Internet Explorer. John
On 18/08/2021 08:20, John Emmas wrote:
no matter which version I try to download I just get directed to a weird page saying "JFrog" which won't let me go any further :-(
Anyone know what's happening here? I've tried with Microsoft Edge and even the old Internet Explorer.
Safari seemed a bit happier so I installed ver 1.74 and eventually ver 1.77 - but they both give me the same error list :-( So I'm guessing this might be a Visual Studio issue. Edward - do you happen to know which version of VS2019 you're running? John
On 8/18/2021 5:03 AM, John Emmas via Boost-users wrote:
On 18/08/2021 08:20, John Emmas wrote:
no matter which version I try to download I just get directed to a weird page saying "JFrog" which won't let me go any further :-(
Anyone know what's happening here? I've tried with Microsoft Edge and even the old Internet Explorer.
Safari seemed a bit happier so I installed ver 1.74 and eventually ver 1.77 - but they both give me the same error list :-(
So I'm guessing this might be a Visual Studio issue. Edward - do you happen to know which version of VS2019 you're running?
I am running VS2019 16.10.3.
On 18/08/2021 14:11, Edward Diener via Boost-users wrote:
On 8/18/2021 5:03 AM, John Emmas via Boost-users wrote:
Safari seemed a bit happier so I installed ver 1.74 and eventually ver 1.77 - but they both give me the same error list :-(
So I'm guessing this might be a Visual Studio issue. Edward - do you happen to know which version of VS2019 you're running?
I am running VS2019 16.10.3.
Hi Edward, there's been a development here after I flagged this up to Microsoft.... I sent them a small test project and it seems that for VS2019 16.11.0 the problem only happens for an x86 build (if I build as x64 it works okay). Going back to the command line you sent me last week, is there some way I can adapt it to force an x86 build and alternatively, an x64 build? I could then swap between them and see if there's any difference here. And it looks like John Maddock might be onto something when he suggested modifying 'boost/integer/common_factor_rt.hpp'. I'd be happy to try modifying it temporarily if John can suggest something... Thanks, John On 16/08/2021 18:57, John Maddock via Boost-users wrote:
#if ((defined(BOOST_MSVC) && (BOOST_MSVC >= 1600)) || (defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64)) #include
#endif I'm wondering if the check for x86 needs to be applied to the BOOST_MSVC check as well as the intel one?
On 23/08/2021 09:23, John Emmas via Boost-users wrote:
On 18/08/2021 14:11, Edward Diener via Boost-users wrote:
On 8/18/2021 5:03 AM, John Emmas via Boost-users wrote:
Safari seemed a bit happier so I installed ver 1.74 and eventually ver 1.77 - but they both give me the same error list :-(
So I'm guessing this might be a Visual Studio issue. Edward - do you happen to know which version of VS2019 you're running?
I am running VS2019 16.10.3.
Hi Edward, there's been a development here after I flagged this up to Microsoft....
I sent them a small test project and it seems that for VS2019 16.11.0 the problem only happens for an x86 build (if I build as x64 it works okay). Going back to the command line you sent me last week, is there some way I can adapt it to force an x86 build and alternatively, an x64 build? I could then swap between them and see if there's any difference here. And it looks like John Maddock might be onto something when he suggested modifying 'boost/integer/common_factor_rt.hpp'. I'd be happy to try modifying it temporarily if John can suggest something... Thanks,
Works for me with VS2019 16.11.1 and building for x86.
What happens if you just do a:
#include
On 23/08/2021 12:47, John Maddock via Boost-users wrote:
Works for me with VS2019 16.11.1 and building for x86.
What happens if you just do a:
#include
Good suggestion - that gives me the same situation (build problems when 32-bit) but interestingly.... On 23/08/2021 13:00, Edward Diener via Boost-users wrote:
It is a matter of the command prompt. The vcvars32.bat command prompt is for an x86 build and the vcvars64.bat is for an x64 build. You are correct that I tried it for an x64 build. However trying the code for an x86 build was also successful for me.
I just tried both command prompts here and they both gave me the same problem ?!? John
On 23/08/2021 12:47, John Maddock via Boost-users wrote:
What happens if you just do a:
#include
Hi John - one more question.... my version of intrin.h seems to be 53,878 bytes size and it’s in a path which ends:- "VC\Tools\MSVC\14.29.30133\Include" Just wondering if it's the same for you and Edward? John
On 8/23/2021 10:22 AM, John Emmas via Boost-users wrote:
On 23/08/2021 12:47, John Maddock via Boost-users wrote:
What happens if you just do a:
#include
Hi John - one more question.... my version of intrin.h seems to be 53,878 bytes size and it’s in a path which ends:- "VC\Tools\MSVC\14.29.30133\Include"
Just wondering if it's the same for you and Edward?
My intrin.h is 53,878 bytes also.
On 23/08/2021 13:33, John Emmas via Boost-users wrote:
On 23/08/2021 12:47, John Maddock via Boost-users wrote:
Works for me with VS2019 16.11.1 and building for x86.
What happens if you just do a:
#include
Good suggestion - that gives me the same situation (build problems when 32-bit) but interestingly....
That looks like an issue with your VS install then? Not the answer you're looking for I'm sure, but I would tend to do a reinstall in a situation like this. I suspect you have a mangled platform header somewhere. Best, John. -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
On 23/08/2021 18:12, John Maddock via Boost-users wrote:
I suspect you have a mangled platform header somewhere.
I found it !!!
FWIW the problematic file (ammintrin.h) gets #included quite early in
intrin.h like this:-
#if (defined (_M_IX86) || defined (_M_X64)) &&
!defined(_CHPE_ONLY_)
#include
On 8/23/2021 4:23 AM, John Emmas via Boost-users wrote:
On 18/08/2021 14:11, Edward Diener via Boost-users wrote:
On 8/18/2021 5:03 AM, John Emmas via Boost-users wrote:
Safari seemed a bit happier so I installed ver 1.74 and eventually ver 1.77 - but they both give me the same error list :-(
So I'm guessing this might be a Visual Studio issue. Edward - do you happen to know which version of VS2019 you're running?
I am running VS2019 16.10.3.
Hi Edward, there's been a development here after I flagged this up to Microsoft....
I sent them a small test project and it seems that for VS2019 16.11.0 the problem only happens for an x86 build (if I build as x64 it works okay). Going back to the command line you sent me last week, is there some way I can adapt it to force an x86 build and alternatively, an x64 build? I could then swap between them and see if there's any difference here. And it looks like John Maddock might be onto something when he suggested modifying 'boost/integer/common_factor_rt.hpp'. I'd be happy to try modifying it temporarily if John can suggest something... Thanks,
John
It is a matter of the command prompt. The vcvars32.bat command prompt is for an x86 build and the vcvars64.bat is for an x64 build. You are correct that I tried it for an x64 build. However trying the code for an x86 build was also successful for me.
On 16/08/2021 18:57, John Maddock via Boost-users wrote:
#if ((defined(BOOST_MSVC) && (BOOST_MSVC >= 1600)) || (defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64)) #include
#endif I'm wondering if the check for x86 needs to be applied to the BOOST_MSVC check as well as the intel one?
Oh, by the way... On 16/08/2021 18:57, John Maddock via Boost-users wrote:
#if ((defined(BOOST_MSVC) && (BOOST_MSVC >= 1600)) || (defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64)) #include
#endif I'm wondering if the check for x86 needs to be applied to the BOOST_MSVC check as well as the intel one?
If you can let me know what the change would be, I'd be happy to try it temporarily and let you know if it works... John
participants (3)
-
Edward Diener
-
John Emmas
-
John Maddock