Skip to content

Conversation

@Quipyowert2
Copy link
Contributor

@Quipyowert2 Quipyowert2 commented Apr 23, 2023

This pull request fixes the cause of an error I was getting when compiling PR #64 in Visual Studio. The problem is that there is both a xtime symbol (defined by Visual Studio in xtimec.h) and a boost::xtime symbol (which is aliased to xtime by using namespace boost). Replacing all the using namespace std; and using namespace boost; with a using statement specifying the exact type to use (e.g. using std::string;) fixes the error and reduces the possibility of similar compiler errors in the future.

The error I was receiving was the following, repeated several times for several different source files:

1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\condition_variable(143): error C2872: 'xtime': ambiguous symbol
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xtimec.h(23,8): message : could be 'xtime'
1>D:\Linux_home\nathan\src\glob2\vcpkg_installed\x64-windows\x64-windows\include\boost\thread\lock_types.hpp(31,10): message : or       'boost::xtime'
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\condition_variable(148): error C2872: 'xtime': ambiguous symbol
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xtimec.h(23,8): message : could be 'xtime'
1>D:\Linux_home\nathan\src\glob2\vcpkg_installed\x64-windows\x64-windows\include\boost\thread\lock_types.hpp(31,10): message : or       'boost::xtime'
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\condition_variable(258): error C2872: 'xtime': ambiguous symbol
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xtimec.h(23,8): message : could be 'xtime'
1>D:\Linux_home\nathan\src\glob2\vcpkg_installed\x64-windows\x64-windows\include\boost\thread\lock_types.hpp(31,10): message : or       'boost::xtime'

build.log.

@Quipyowert2 Quipyowert2 marked this pull request as draft April 23, 2023 05:25
@Quipyowert2
Copy link
Contributor Author

Oops, forgot to remove a few using namespace lines. The error is still there. Converting to draft for now. Probably going to work on this tomorrow.

@Quipyowert2 Quipyowert2 force-pushed the xtime-ambiguous-symbol branch from 6d549cd to 958e22d Compare April 23, 2023 20:45
@Quipyowert2 Quipyowert2 marked this pull request as ready for review April 23, 2023 20:45
@stephanemagnenat stephanemagnenat merged commit 9a1c29f into Globulation2:master Apr 24, 2023
@Quipyowert2 Quipyowert2 mentioned this pull request May 7, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants