-
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
Compile with MinGW-64 (G++) #66
Comments
What platform are you trying this on? From the ".lib" I would assume a flavor of Windows? I don't know Windows very well, and what limited experience I have with it is all with MSVC. So I'm not sure how much I can help. But... It appears that you're working out of a build tree without installing it. In that case, the include files are not where you might expect. After install, the tree might look like:
So there's an Then, in Linux, the g++ switch '-L' tells the linker where to look for files, but the '-l' (lower-case L) tells it the library files. I would assume MinGW does the same? So, all together, the command line is:
|
Yeah, i'm trying to compile it in windows in order to run on it which I am using as a client where I connect to it from a linux server. I'm pretty sure it should be very similar due to my experience using the MinGW compiler on both windows and linux being about the same in terms of command line parameters. I'll give that command a try in a bit, just out at the moment but thank you very much otherwise for your feedback! |
So I tried running this compile command: But my G++ compiler was unable to identify what "-lsockpp" is, outputting: cannot find -lsockpp (returned 1 exit status) on Windows. I was able to get it to work on Visual C++ but I couldn't get it to compile in release mode so it would not have to require the microsoft DLL's such as MSVCP140D.dll on any computer is runs on (self-contained). But so far this MinGW compiler I am using on Windows is installed the same way as it would be on linux and works as intended. It is definitely a bit trickier on windows to perform these types of tasks but would you know how I could get MinGW to recognize what -lsockpp is? |
Sorry I never got back to this. I kept trying to figure out networking on Windows with MinGW, but I couldn't figure out the way different versions of the compiler define different macros. Like some versions seem to define So I gave up. Windows isn't a huge priority for me, and just getting MSVC working was enough of a chore. If you figured it out, let me know. I'm happy to put up instructions in the README or take whatever PR to make it work. But, for completeness, with gcc,
|
Hi fpagliughi,
Would you happen to know how to compile a sockpp included CPP file properly with G++? I've tried many including:
g++ main.cpp -o main -I "sockpp/include/" -L "sockpp/build/Debug/sockpp-static.lib"
Including both the path and the linker file location. The program compiles properly when I have the actual include statement (example: #include <sockpp/tcp_connector.h>) only - but when trying to add a TCP connector (example: sockpp::tcp_connector conn({"localhost", 12345});) - it fails to compile.
The text was updated successfully, but these errors were encountered: