 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chris_12345 Guest
|
Posted: Wed Jun 27, 2012 7:07 pm Post subject: On Windows 7, how do you reference a "static library" (a dot |
|
|
I'm using Windows 7, NetBeans 7.1.2 and the C:\MinGW\bin\g++.exe compiler/linker.
I have been trying to reference a static library (file.lib) using linker options such as "-l" and "-L". All attempts have been unsuccessful (one possible reason is) because the "-l" option only takes the name of the library (without a leading "lib" in the filename and no suffix) and probably not a path to the library file. The "L" option takes a path to the folder containing the library, but it does not work for me.
http://mingw.org/wiki/LibraryPathHOWTO
My question is how do you reference a static library within NetBeans?
You can modify the (NetBeans) project's linking options by right clicking on the project and selecting properties. From there, you can specify a library folder, a specific library file, or you can enter a specific linker option such as "-lfile".
I have tried various ways to get my project to use the dot lib without success. When I build the project, I get a lot of undefined references.
Thanks |
|
| Back to top |
|
 |
Victor Bazarov Guest
|
Posted: Wed Jun 27, 2012 7:07 pm Post subject: Re: On Windows 7, how do you reference a "static library" (a |
|
|
On 6/27/2012 3:07 PM, Chris_12345 wrote:
| Quote: | [..]
My question is how do you reference a static library within NetBeans?
[..]
|
This question is off-topic in a language newsgroup. See FAQ section 5
for the suggestions where to take your off-topic inquiry. You can find
the FAQ here: http://www.parashift.com/c++-faq-lite/
V
--
I do not respond to top-posted replies, please don't ask |
|
| Back to top |
|
 |
MelissA Guest
|
Posted: Wed Jun 27, 2012 7:07 pm Post subject: Re: On Windows 7, how do you reference a "static library" (a |
|
|
On Wed, 27 Jun 2012 12:07:01 -0700 (PDT)
Chris_12345 <clusardi2k (AT) aol (DOT) com> wrote:
| Quote: | I'm using Windows 7, NetBeans 7.1.2 and the C:\MinGW\bin\g++.exe
compiler/linker.
I have been trying to reference a static library (file.lib) using
linker options such as "-l" and "-L". All attempts have been
unsuccessful (one possible reason is) because the "-l" option only
takes the name of the library (without a leading "lib" in the
filename and no suffix) and probably not a path to the library file.
The "L" option takes a path to the folder containing the library, but
it does not work for me.
http://mingw.org/wiki/LibraryPathHOWTO
My question is how do you reference a static library within NetBeans?
You can modify the (NetBeans) project's linking options by right
clicking on the project and selecting properties. From there, you can
specify a library folder, a specific library file, or you can enter a
specific linker option such as "-lfile".
I have tried various ways to get my project to use the dot lib
without success. When I build the project, I get a lot of undefined
references.
Thanks
|
Isn't library just another object file (archive)? You don't need -l
option, just add library to g++ command line as ordinary object file. |
|
| Back to top |
|
 |
io_x Guest
|
Posted: Thu Jun 28, 2012 1:59 pm Post subject: Re: On Windows 7, how do you reference a "static library" (a |
|
|
"Chris_12345" <clusardi2k (AT) aol (DOT) com> ha scritto nel messaggio
news:916849b4-c3bd-4ad5-a01d-bad0ee12be57 (AT) googlegroups (DOT) com...
I'm using Windows 7, NetBeans 7.1.2 and the C:\MinGW\bin\g++.exe
compiler/linker.
I have been trying to reference a static library (file.lib) using linker options
such as "-l" and "-L".
#io_x
#i put the library file library.lib and the
#library.dll files in the same directory of the file.cpp that use it
#and type
#bcc32 -v file library.lib
All attempts have been unsuccessful (one possible reason is) because the "-l"
option only takes the name of the library (without a leading "lib" in the
filename and no suffix) and probably not a path to the library file. The "L"
option takes a path to the folder containing the library, but it does not work
for me. |
|
| Back to top |
|
 |
Powered by phpBB © 2001, 2006 phpBB Group
|