[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Windows 7, How do you reference a Visual Studio 2008 "static library"
From: |
clusardi2k |
Subject: |
On Windows 7, How do you reference a Visual Studio 2008 "static library" (a dot lib) and a "dynamic library" (a dot dll) in NetBeans which uses g++ |
Date: |
Thu, 28 Jun 2012 05:46:47 -0700 (PDT) |
User-agent: |
G2/1.0 |
I'm using Windows 7, NetBeans 7.1.2, C:\MinGW\bin\g++.exe compiler/linker, and
writing code in C and Java.
The most important question: I have a dot lib and a dot dll produced from the
Visual Studio 2008 compiler. Can I use these two files with MinGW g++ compiled
code? I want to compile/link my own two NetBeans projects using g++ with two
libraries (the dot lib and dot dll) produced by Visual Studio 2008?
If I can use the dot lib and the dot dll then answers to the below two
questions are important to me.
Background: I have two NetBeans projects. The first project is written in Java
and communicates with a C++ project using the JNI (Java Native Interface). The
C++ project uses a subset of a large C++ library. The Java project has a main
method that invokes my C++ project.
I'm suppose to use a proprietary dot lib to be able to compile my C++ project,
and use the dot dll to be able to run the two projects together.
====================================================================
Second Question:
I have been trying to reference a static library (file.lib) using linker
options such as "-l" and "-L". All attempts have been unsuccessful partly
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. I tried to set the PATH environment variable but that
didn't fix the problem.
http://mingw.org/wiki/LibraryPathHOWTO
My second 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.
Third Question:
My third question is how do you reference a dynamic library (a dot dll) within
NetBeans? I have a proprietary dot dll, so I ask where and how do I use it.
Thanks
- On Windows 7, How do you reference a Visual Studio 2008 "static library" (a dot lib) and a "dynamic library" (a dot dll) in NetBeans which uses g++,
clusardi2k <=