c++ - Eclipse CDT - Link individual library with space in file path -
using eclipse cdt, trying link single library (.lib) file project.
during compilation, result of space character in file path, path split around space, causing file not found, , preventing compilation executing successfully. execution string generated eclipse.
g++ -static-libgcc -static-libstdc++ -o "test.exe" "src\\test.o" -lc:/program files/java/jdk1.7.0_15/lib/jvm.lib g++: error: files/java/jdk1.7.0_15/lib/jvm.lib: no such file or directory
overall, has trouble constructing library option compilation:
-lc:/program files/java/jdk1.7.0_15/lib/jvm.lib
i've tried both surrounding path in quotes , adding path's directory library path, yet -l
option malformed in both cases.
how can add library space in path eclipse cdt?
you should enclose path, has spaces, qoutes.
you should specify library name (that
jvm
) @ libraries tab. specify"c:/program files/java/jdk1.7.0_15/lib"
@ library paths tab.
the point "-lc:/program files/java/jdk1.7.0_15/lib/jvm.lib"
is valid option formation, command interpreter treat single option drop quotations.
so, when type g++ "-lc:/program files/java/jdk1.7.0_15/lib/jvm.lib"
in cmd, argument passed g++ -lc:/program files/java/jdk1.7.0_15/lib/jvm.lib
without quotes.
however, -l<path-to-library-file>
invalid option gcc
itself. can either use g++ <path-to-library-file>
or g++ -l<path-to-library-dir> -l<library-name>
.
so, valid options be
g++ <..> "src\\test.o" "-lc:/program files/java/jdk1.7.0_15/lib" -ljvm
Comments
Post a Comment