I’ve just set up MinGW environment following this post
But how to add 3rd party libraries to it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A library consists of two main components – the C header files and the compiled object code archive. GCC has a bewildering array of ways of specifying these things, but let’s say you are using a library
foo.awhich lives in the relative directory pathfoo/lib, and a headerfoo.hwhich lives infoo/inc. Your own C code lives inmain.cand looks like this:To compile this, you could use the command line:
the -I flag adds to the path searched for headers. You can also add to the lib path, but then things start to get complicated 🙂