Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking errors to __dtol3, __ltod3 in Visual Studio CTP_Nov2013 #205

Closed
nlguillemot opened this issue Jan 5, 2014 · 3 comments
Closed
Labels
support Windows Win32 specific (not Cygwin or WSL)
Milestone

Comments

@nlguillemot
Copy link

After upgrading my Visual C++ compiler to CTP_Nov2013, I started getting linking errors in win32_time.c. They were unresolved references to __dtol3 and __ltod3.

I narrowed it down to the following lines in this version of win32_time.c
Line 44 causes __ltod3:
_glfw.win32.timer.resolution = 1.0 / (double) freq;
Line 68 causes __ltod3:
t = (double)(t_64 - _glfw.win32.timer.t0_64);
Line 83 causes __dtol3:
_glfw.win32.timer.t0_64 = t_64 - (__int64) (t / _glfw.win32.timer.resolution);

Seems like casting between long longs and doubles is causing problems.

I managed to solve it by following the advice here
More specifically, I added the following line to glfw's root CMakeLists.txt in the MSVC compiler specific flags section to use SSE instead of SSE2: set (CMAKE_C_FLAGS "/arch:SSE")

I'm not sure if that's the right solution, and I'm also using a slightly out of date version of glfw. This issue might manifest itself slightly differently now.

To test it, build glfw using Visual Studio 2013 and the November 2013 CTP

@nlguillemot
Copy link
Author

I wonder if this is related to #169, since they're both related to SSE.

@retep998
Copy link

retep998 commented Jan 5, 2014

The CTP is clearly going to be buggy, through no fault of GLFW's.
You'd be better off reporting this bug to Microsoft.
https://connect.microsoft.com/VisualStudio

@nlguillemot
Copy link
Author

Done. https://connect.microsoft.com/VisualStudio/feedback/details/813008/linking-errors-to-dtol3-and-ltod3

Meanwhile, this workaround might be useful for others using the CTP. Do with it what you will.

@elmindreda elmindreda added support and removed question Please use the support label instead labels Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Windows Win32 specific (not Cygwin or WSL)
Projects
None yet
Development

No branches or pull requests

3 participants