At very best, you'll have to type "g++ main.cpp -lgmp"
g++ can't (unfortunately) magically determine the location to the header files. (And it's not a good idea to use absolute locations... who says I even have a C: ?) You can supply the location in a couple of ways:
1) Using the -I / -L flags as you already have. If you use a makefile, you can simply put CFLAGS = -IC:\etc..., and add the -L flag to wherever you link. (If you're compiling everything on the command line, I would highly suggest looking into either makefiles or an IDE - either helps simplify large projects with many files.)
2) You can copy the headers and *.a files into their respective directories wherever you have g++, alongside the standard headers/libraries.
3) You can setup the environment variables as mentioned above. I do this in my autoexec.bat file:
Code:
SET CPATH=N:\MinGW\addons\include
SET LIBRARY_PATH=N:\MinGW\addons\lib
Substitute your paths as needed, of course. You can also run those SET commands in just a command prompt (cmd or command) and they'll work, but only for that prompt until that prompt is closed, which is a great way to make sure they work first. (Of course, they work in batch files too, if you carry gcc on a usb drive like I do.
)