Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » adding a C library to a C++ project?(Getting "cannot find -law.lib" error message when trying to compile)
adding a C library to a C++ project? [message #722466] Mon, 05 September 2011 21:14 Go to next message
John LaLuna is currently offline John LaLunaFriend
Messages: 4
Registered: September 2011
Junior Member
I've been using vc++ for too long and want to move my code over to Eclipse. I have also been taking classes at my local community college which uses Eclipse. They have been unable to answer my question about this.

When using vc++ all I had to do was add a path and add a library file to link to. So for example I'd add h:\awsdk\ for my path, #include "aw.h" to my code, then add aw.lib to be linked. Done. The lib is precompiled and I do not have the source to it.

I've tried the same thing with Eclipse but am obviously doing something wrong as I get numerous errors, not the least of which is "cannot find -law.lib".

I am using MinGW GCC and a fresh install of Eclipse. I have been clicking on my project, then file>properties>C/C++ General>Paths and Symbols> then editing Library Paths, and Library.

[Updated on: Mon, 05 September 2011 21:15]

Report message to a moderator

(no subject) [message #722488 is a reply to message #722466] Mon, 05 September 2011 23:41 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 05-Sep-11 15:14, John wrote:
>
> I've been using vc++ for too long and want to move my code over to
> Eclipse. I have also been taking classes at my local community college
> which uses Eclipse. They have been unable to answer my question about this.
>
> When using vc++ all I had to do was add a path and add a library file to
> link to. So for example I'd add h:\awsdk\ for my path, #include "aw.h"
> to my code, then add aw.lib to be linked. Done. The lib is precompiled
> and I do not have the source to it.
>
> I've tried the same thing with Eclipse but am obviously doing something
> wrong as I get numerous errors, not the least of which is "cannot find
> -law.lib".
>
> I am using MinGW GCC and a fresh install of Eclipse. I have been
> clicking on my project, then file>properties>C/C++ General>Paths and
> Symbols> then editing Library Paths, and Library.

Sticky post at top of this forum:
http://www.eclipse.org/forums/index.php/t/161206/
Previous Topic:Reasons for backtracking while coding
Next Topic:Step into Native code?
Goto Forum:
  


Current Time: Fri Apr 19 21:18:27 GMT 2024

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

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

Back to the top