-
Notifications
You must be signed in to change notification settings - Fork 142
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
MSVC not compiling when including "rang.hpp" #63
Comments
By the way I manually fixed it in my code by basically putting the "getVersionDependentHandle" code everywhere is it called, doing the inlining for the compiler! That works properly but may be interesting to look into this error. (Also commented the getVersionDependentHandle function) |
@tatjam Thankyou for the bug report as well as your solution for it. Could you try one thing and put
This should fix the error and if your program builds, I'll commit the change :) |
Alright I will try it, will reply in a moment |
Well, this is strange! Writing inline before it worked, but required me to do the same on |
Will try to compile on gcc with both the original and the modified version to see if this has to do with MSVC (I suppose it does) EDIT: Sadly compiling with gcc (on windows) is not easily done with mingw, but I suppose adding these inlines should not break compiling on stuff different from MSVC |
Don't worry about gcc and clang compilers, I'll test them myself 😸 . I don't have an windows machine or vm image nearby otherwise I would've tested it myself. I'll download the vm image again but it'll take some time(20+ GB on 8Mb/sec connection 😂 ). Just tell me the minimum modifications you did to solve the problem and I'll run the tests on different sets of compilers 👍 . Thanks! |
isn't Also sorry for lack of proper documentation, but you don't need to call |
Oh I downloaded it from "Releases", instead of directly from the repo. Indeed the file on the repo is correct. It just requires to put an inline behind the |
@tatjam I've uploaded a new release with right changes - https://github.com/agauniyal/rang/releases/tag/2.1. I hope it builds easily now and you make something cool out of it 🎉 . I'll be closing this issue but feel free to reopen if something doesn't works as expected 😄 . |
I'm not sure what am I doing wrong but whenever I include "rang.hpp" outside of Main.cpp i get this compile error:
error LNK2005: "void * __cdecl rang::rang_implementation::getVersionDependentHandle(void)" (?getVersionDependentHandle@rang_implementation@rang@@YAPAXXZ) already defined in [Wathever].obj
Any idea what is happening
and how could I fix it?The text was updated successfully, but these errors were encountered: