probs adding linker option in g++

Hi all

Im trying to compile a C++ program, however Im having issues trying to link a particular library to the compiling and linking statement.

Here is what Im doing


g++ mips4 -std=c++98 -g disk_reporter.cpp -o disk_reporter

If I do this alone, the linker complains that library file /usr/lib32/libm.so is not used to resolve symbols. Also, I have tried these options

g++ mips4 -std=c++98 -g disk_reporter.cpp -o disk_reporter -L/usr/lib32/libm.so 

g++ mips4 -std=c++98 -g disk_reporter.cpp -L/usr/lib32/libm.so  -o disk_reporter 

but I didn't see anything different

Is there anything I could be doing wrong ? (Im using Irix 6.5 btw as my operating system)

You need something like

g++ mips4 -std=c++98 -g disk_reporter.cpp -o disk_reporter -lm

to link the library. If that does not work, try

g++ mips4 -std=c++98 -g disk_reporter.cpp -o disk_reporter -lm -L/usr/lib32

-l tells the linker a library to use; -L tells it where to look for libraries.

Sorry, still no different although thanks for trying.