Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » managed-make problem with a library
managed-make problem with a library [message #114631] Sat, 07 August 2004 09:17 Go to next message
Eclipse UserFriend
Originally posted by: eyalunderdream.hotmail.com

Hi,

I'm a newbie to CDT.
I'm using a managed make project on an XP with cygwin, and i'm trying
to link a library (which I created in another project). I've manually
added the library directories to the compiler include path and to the
linker library path and library list. This is the console output:

make -k all
Building target: CPP_tmp2.exe
g++ -L"D:\eclipse\workspace\CPP_lib2\Debug" -oCPP_tmp2.exe main.o
-lCPP_lib2.dll
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cy gwin/bin/ld:
cannot find -lCPP_lib2.dll
collect2: ld returned 1 exit status
make: *** [CPP_tmp2.exe] Error 1
make: Target `all' not remade because of errors.
Build complete for project CPP_tmp2

P.S: Is there any other more elegant way of including the library without
manually changing the complier/linker settings?
Re: managed-make problem with a library [message #114759 is a reply to message #114631] Mon, 09 August 2004 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Well Eyal,
I'm open to suggestions on a more elegant way to tell the compiler to
link in an external library. It looks from your output as though you
have specified the extension of the dll in the UI. Typically, you only
specify the name of the library to the -l flag and the linker wrapper
adds the prefix and extension silently (i.e. you specify -lfoo and the
linker will search for libfoo.a). Try that and see if it helps.

Sean

Eyal wrote:
> Hi,
>
> I'm a newbie to CDT.
> I'm using a managed make project on an XP with cygwin, and i'm trying
> to link a library (which I created in another project). I've manually
> added the library directories to the compiler include path and to the
> linker library path and library list. This is the console output:
>
> make -k all
> Building target: CPP_tmp2.exe
> g++ -L"D:\eclipse\workspace\CPP_lib2\Debug" -oCPP_tmp2.exe main.o
> -lCPP_lib2.dll
> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cy gwin/bin/ld:
> cannot find -lCPP_lib2.dll
> collect2: ld returned 1 exit status
> make: *** [CPP_tmp2.exe] Error 1
> make: Target `all' not remade because of errors.
> Build complete for project CPP_tmp2
>
> P.S: Is there any other more elegant way of including the library without
> manually changing the complier/linker settings?
>
Re: managed-make problem with a library [message #115205 is a reply to message #114759] Thu, 12 August 2004 02:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eyalunderdream.hotmail.com

Thanks a zillion, it worked!!
By more elegant, I mean that when you specify in your project references
project A, it will automatically add A's path to the
include paths, library paths (-L), and its library name to the library
list (-l).

Sean Evoy wrote:

> Well Eyal,
> I'm open to suggestions on a more elegant way to tell the compiler to
> link in an external library. It looks from your output as though you
> have specified the extension of the dll in the UI. Typically, you only
> specify the name of the library to the -l flag and the linker wrapper
> adds the prefix and extension silently (i.e. you specify -lfoo and the
> linker will search for libfoo.a). Try that and see if it helps.

> Sean

> Eyal wrote:
> > Hi,
> >
> > I'm a newbie to CDT.
> > I'm using a managed make project on an XP with cygwin, and i'm trying
> > to link a library (which I created in another project). I've manually
> > added the library directories to the compiler include path and to the
> > linker library path and library list. This is the console output:
> >
> > make -k all
> > Building target: CPP_tmp2.exe
> > g++ -L"D:eclipseworkspaceCPP_lib2Debug" -oCPP_tmp2.exe main.o
> > -lCPP_lib2.dll
> > /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cy gwin/bin/ld:
> > cannot find -lCPP_lib2.dll
> > collect2: ld returned 1 exit status
> > make: *** [CPP_tmp2.exe] Error 1
> > make: Target `all' not remade because of errors.
> > Build complete for project CPP_tmp2
> >
> > P.S: Is there any other more elegant way of including the library without
> > manually changing the complier/linker settings?
> >
Re: managed-make problem with a library [message #115231 is a reply to message #115205] Thu, 12 August 2004 08:49 Go to previous message
Eclipse UserFriend
Eyal,
Agreed. It's on my list of usability enhancements.

Sean

Eyal wrote:
> Thanks a zillion, it worked!!
> By more elegant, I mean that when you specify in your project references
> project A, it will automatically add A's path to the
> include paths, library paths (-L), and its library name to the library
> list (-l).
>
> Sean Evoy wrote:
>
>
>>Well Eyal,
>>I'm open to suggestions on a more elegant way to tell the compiler to
>>link in an external library. It looks from your output as though you
>>have specified the extension of the dll in the UI. Typically, you only
>>specify the name of the library to the -l flag and the linker wrapper
>>adds the prefix and extension silently (i.e. you specify -lfoo and the
>>linker will search for libfoo.a). Try that and see if it helps.
>
>
>>Sean
>
>
>>Eyal wrote:
>>
>>>Hi,
>>>
>>>I'm a newbie to CDT.
>>>I'm using a managed make project on an XP with cygwin, and i'm trying
>>>to link a library (which I created in another project). I've manually
>>>added the library directories to the compiler include path and to the
>>>linker library path and library list. This is the console output:
>>>
>>>make -k all
>>>Building target: CPP_tmp2.exe
>>>g++ -L"D:eclipseworkspaceCPP_lib2Debug" -oCPP_tmp2.exe main.o
>>>-lCPP_lib2.dll
>>> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cy gwin/bin/ld:
>>>cannot find -lCPP_lib2.dll
>>>collect2: ld returned 1 exit status
>>>make: *** [CPP_tmp2.exe] Error 1
>>>make: Target `all' not remade because of errors.
>>>Build complete for project CPP_tmp2
>>>
>>>P.S: Is there any other more elegant way of including the library without
>>>manually changing the complier/linker settings?
>>>
>
>
>
Previous Topic:Passing arguments to build command:
Next Topic:CDT FAQ
Goto Forum:
  


Current Time: Wed Apr 30 09:03:39 EDT 2025

Powered by FUDForum. Page generated in 0.04824 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top