Linkerproblem with STLPort [message #90199] |
Thu, 18 December 2003 17:20  |
Eclipse User |
|
|
|
Originally posted by: toomy.bluewin.ch
Hi
I have successfuly installed CDT, have compiled and linked a small
application.
I have WinXp and Eclipse 3.0M5 and CDT 2.0M5 installed.
I need to use the libary STLport and boost. I have successuly compiled and
linked the libraries. I have compiled and linked successfuly with the
stlport library by invoking g++ from the cmd line.
I am not able link the STLport lib with CDT. I have setup the
ProjectSettings C/C++ Build both Release and Debug Settings.
The linker path is like the following:
C:\cygwin\usr\local\lib\libstlport_cygwin.a
The output is as follow:
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cy gwin/bin/ld
cannot find -lC:\cygwin\usr\local\lib\libstlport_cygwin.a
Does anybody know what is wrong?
Thanks Markus
|
|
|
|
|
Re: Linkerproblem with STLPort [message #90273 is a reply to message #90258] |
Fri, 19 December 2003 04:04  |
Eclipse User |
|
|
|
Markus wrote:
> Thanks now it works, I added the full pathe in misc/oterObjects.
>
> Why does it not work if I add the path "C:\cygwin\usr\local\lib" to the
> library search path and the lib "libstlport_cygwin.a" to the libs?
I gave you the second version with path and lib divided below.
When using -L and -l, the linker will you the paths given with -L as
additional search paths to the system library search path. When
providing libs with -l to the linker, ld (the linker) will add the
prefix 'lib' infront of the given lib and the proper extension ('.a') at
the end.
Examples:
-lstdc++ -> libstdc++.a
-lm -> libm.a
-lxml2 -> libxml2.a
This makes it more simple to find out, what is a lib and what not, and
how is the name of the lib. You strip the 'lib'-prefix and the extension
and you get the name of the library.
This is for GCC Toolchain only, Microsoft or Borland don't do this.
When using these to compilers, you have to give them the full library
name like libstdc++.lib. They usually also don't use the 'lib'-prefix.
> Do I have in general add the libs I want to use in the misc/otherObjects?
No, it depends on your libs you use. When they follow the naming
convention above, you can add them like described above. But for
Microsoft or Borland compilers, you'll have to add them under
misc/otherObjs.
> Thanks
>
> kesselhaus wrote:
>
>
>>Markus wrote:
>
>
>>>Hi
>>>I have successfuly installed CDT, have compiled and linked a small
>>>application.
>>>I have WinXp and Eclipse 3.0M5 and CDT 2.0M5 installed.
>>>I need to use the libary STLport and boost. I have successuly compiled and
>>>linked the libraries. I have compiled and linked successfuly with the
>>>stlport library by invoking g++ from the cmd line.
>>>
>>>I am not able link the STLport lib with CDT. I have setup the
>>>ProjectSettings C/C++ Build both Release and Debug Settings.
>>>The linker path is like the following:
>>>
>>>C:cygwinusrlocalliblibstlport_cygwin.a
>>>
>>>The output is as follow:
>>> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cy gwin/bin/ld
>>>cannot find -lC:cygwinusrlocalliblibstlport_cygwin.a
>>
>> ^^^^^^
>
>
>>You don't add libraries with -l when using full path! When using full
>>path, add this in your Makefile to the linker flags like:
>
>
>>LDFLAGS += C:cygwinusrlocalliblibstlport_cygwin.a
>
>
>>When you use Managed Build, in the project settings add the full path in
>>the Linker page under Miscelleanous in the bottom field. Not on the
>>second by "-l"!
>
>
>>Or you use -L and -l like this way:
>>-L"C:cygwinusrlocallib" -lstlport_cygwin
>
>
>>>Does anybody know what is wrong?
>>>Thanks Markus
>>>
>>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04821 seconds