-
Notifications
You must be signed in to change notification settings - Fork 265
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
Crosscompile linux to windows: linking fails, undefined reference SSL_library_init 3.9.2 #1053
Comments
Can you please say more about what commands you used to build your main.cpp file, and its contents? |
Here's a quick working example for you to play with:
Keep in mind you should install the library somewhere (implied, but not explicitly spelled out in the README) in order to use it, and you'll also need to explicitly link in some support libraries on Windows that are implicit on other platforms. I think the linker script should help you automatically here, but if you're cross-compiling straight from the command line, you're probably not using it. Hope this helps! |
@RandomInEqualities do you think this needs more clarification in the docs, or is something like this fairly clear when folks are targeting Windows already? |
I think if using CMake this is all handled by that, so nothing is needed there! I'm not sure about cross compiling, since that does require the extra -lws2_32 and installing the library. Maybe it could be mentioned in an additional section about cross-compiling (but mind I don't cross compile myself, so I don't know too much about it). |
I compiled it for windows using linux with the README.windows commands
i got three library files, tls.a,ssl.a and crypto.a
but when i tried using them i got the following error message:
but everything works well when compiling with just gcc on linux for linux, the error only occurs when crosscompiling
The text was updated successfully, but these errors were encountered: