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

multiple definition errors on Windows (at link time) #27

Open
bsergean opened this issue Jun 12, 2020 · 0 comments
Open

multiple definition errors on Windows (at link time) #27

bsergean opened this issue Jun 12, 2020 · 0 comments

Comments

@bsergean
Copy link

I am getting errors like this when include libnoise.hpp in multiple source (cpp) files in my project (https://github.com/machinezone/IXWebSocket)

Example file -> https://github.com/machinezone/IXWebSocket/blob/ac9710d5d6e1c3dba1c681168cca39e358ab73ef/ws/ws_redis_cli.cpp

(?grm@ansi@linenoise@@3UGRM@12@A) already defined in ws_connect.obj [D:\a\IXWebSocket\IXWebSocket\build\ws\ws.vcxproj]
ws_redis_cli.obj : error LNK2005: "struct _COORD linenoise::ansi::SavePos" (?SavePos@ansi@linenoise@@3U_COORD@@A) already defined in ws_connect.obj [D:\a\IXWebSocket\IXWebSocket\build\ws\ws.vcxproj]
ws_redis_cli.obj : error LNK2005: "int linenoise::ansi::nCharInBuffer" (?nCharInBuffer@ansi@linenoise@@3HA) already defined in ws_connect.obj [D:\a\IXWebSocket\IXWebSocket\build\ws\ws.vcxproj]
ws_redis_cli.obj : error LNK2005: "wchar_t * linenoise::ansi::ChBuffer" (?ChBuffer@ansi@linenoise@@3PA_WA) already defined in ws_connect.obj [D:\a\IXWebSocket\IXWebSocket\build\ws\ws.vcxproj]

The way I solved it is by moving the body in an implementation file, but I wonder if there's a better way.

(fix => machinezone/IXWebSocket@6ed8723)

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

No branches or pull requests

1 participant