-
Notifications
You must be signed in to change notification settings - Fork 126
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 on Windows with minGW-x64 #68
Comments
I'm assuming this issue isn't solved yet. |
I am facing the same issue when building 'example/tcpecho.cpp' with MinGW64-g++. Multiple linking errors were shown as 'undefined reference' even when given correct '-I -L -l' parameters after installation. I assume that this is because the default building tool written in CMake configuration for windows is MSVC, and therefore the library generated is not fully compatible with MinGW. Providing an alternative CMake configuration for MinGW-Windows may be able to solve the problem. |
It turned out that the compatibility issue between MSVC and MinGW was the exact cause of the issue in my case. To address the problem:
If you've already built it via MSVC before, you will have to clean the CMake cache by following the prompt given when you run the command above. |
Sorry. The issue re-occurs when it comes to static library which cannot be solved by rebuilding with MinGW. Maybe this is an issue that requires an update to fix. |
Hey. Sorry. I'm not a Windows programmer and have never used MinGW. So any help or suggestions would be appreciated, as would a PR if a solution is discovered that doesn't break the other platforms. |
I was able to create a static library in both Windows and Linux (using ArchLinux) following the README. Two files were generated:
Then I need to use the static library in another program, which is built using a Makefile.
In Linux no issue occurs, while in Windows with minGW-x64 I received multiple errors like
To reproduce the issue with the example tcp6echo (assuming headers in ./include and static library in ./lib):
g++ -I./include -o tcp6echo tcp6echo.cpp -L./lib -lsockpp
g++ -I./include -o tcp6echo tcp6echo.cpp -L./lib -l:sockpp-static.lib
The text was updated successfully, but these errors were encountered: