Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Using a Precompiled Library
Using a Precompiled Library [message #88904] Thu, 11 December 2003 11:15 Go to next message
Eclipse UserFriend
Originally posted by: mbildner.hotmail.com

I'm trying to setup a C++ project for a class project that I'm working on.
I have a set of files (stored in C:\eclipse\workspace\proj1) that use
classes from a library. The source code to the library is stored in
C:\archlib. I also have access to the precompiled library, which is located
at C:\compArchlib\lib2-5a.a.

What would be the easiest way to get my project to reference the library, so
that it can be built and run?

Thanks for the help.

Michael
Re: Using a Precompiled Library [message #88964 is a reply to message #88904] Thu, 11 December 2003 07:17 Go to previous messageGo to next message
Eclipse UserFriend
Standard Make:
CXXFLAGS += -IC:/archlib/
LDFLAGS += C:/compArchlib/lib2-5a.a

$(TARGET) : $(OBJECTS)
$(CXX) -o $@ $^ $(LDFLAGS)

%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<

Managed Make:

Add the Paths to the Projects settings.
Under Compiler->Directories add the include path
Under Linker->Libraries add path and libname (libname is here 2-5a), or add
under additional the path like above in LDFLAGS

Michael Bildner schrieb:
> I'm trying to setup a C++ project for a class project that I'm working on.
> I have a set of files (stored in C:\eclipse\workspace\proj1) that use
> classes from a library. The source code to the library is stored in
> C:\archlib. I also have access to the precompiled library, which is located
> at C:\compArchlib\lib2-5a.a.
>
> What would be the easiest way to get my project to reference the library, so
> that it can be built and run?
>
> Thanks for the help.
>
> Michael
>
>
Re: Using a Precompiled Library [message #89055 is a reply to message #88964] Thu, 11 December 2003 09:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mbildner.hotmail.com

Okay, I've followed the steps you layed out and I'm glad to say that they
worked. However, I still get one error (the following information is listed
in the Tasks view):

Description: *** [Proj1.exe] Error 1
Resource: Proj1
All other fields are blank.

What is the cause of this, and how can it be fixed ?

Thanks.

Michael
Re: Using a Precompiled Library [message #89558 is a reply to message #89055] Mon, 15 December 2003 11:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alain.nowhere.ca

Michael Bildner wrote:

> Okay, I've followed the steps you layed out and I'm glad to say that they
> worked. However, I still get one error (the following information is listed
> in the Tasks view):

> Description: *** [Proj1.exe] Error 1
> Resource: Proj1
> All other fields are blank.

> What is the cause of this, and how can it be fixed ?

Post the output of the view call C-Build, it contains the trace
of the compilation.

Was it with managed make or Standard make ?
Re: Using a Precompiled Library [message #89587 is a reply to message #89558] Mon, 15 December 2003 04:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mbildner.hotmail.com

The project was a Managed Make project. Below is the output from the
C-Build view:

make clean all
rm -rf dummest.o execute.o fetch_into.o globals.o make_connections.o
run_simulation.o Proj1.exe
g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o dummest.o ../dummest.C
g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o execute.o ../execute.C
g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o fetch_into.o
.../fetch_into.C
g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o globals.o ../globals.C
g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o make_connections.o
.../make_connections.C
g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o run_simulation.o
.../run_simulation.C
g++: Proj1.exe: No such file or directory
make: *** [Proj1.exe] Error 1
g++ -LC:\LibArch\ -o Proj1.exe dummest.o execute.o fetch_into.o
globals.o make_connections.o run_simulation.o -larch2-5a
Build complete for project Proj1

Some extra information about the project ...
The folder C:\LibArch contains the libarch2-5a library that i'm using.
The folder C:\ArchLib2-5a contains the source code for the library.
The file dummest.C contains the main function, and all other files
provided contain added functionality that will be used by dummest.C.

If you need any additional information, let me know. Thanks for the help.

Michael Bildner


> "alain" <alain@nowhere.ca> wrote in message
> Post the output of the view call C-Build, it contains the trace
> of the compilation.
>
> Was it with managed make or Standard make ?
Re: Using a Precompiled Library [message #89720 is a reply to message #89587] Mon, 15 December 2003 17:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alain.nowhere.ca

Michael Bildner wrote:

> The project was a Managed Make project. Below is the output from the
> C-Build view:

> make clean all
> rm -rf dummest.o execute.o fetch_into.o globals.o make_connections.o
> run_simulation.o Proj1.exe
> g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o dummest.o ../dummest.C
> g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o execute.o ../execute.C
> g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o fetch_into.o
> .../fetch_into.C
> g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o globals.o ../globals.C
> g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o make_connections.o
> .../make_connections.C
> g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o run_simulation.o
> .../run_simulation.C
> g++: Proj1.exe: No such file or directory
> make: *** [Proj1.exe] Error 1
> g++ -LC:LibArch -o Proj1.exe dummest.o execute.o fetch_into.o
> globals.o make_connections.o run_simulation.o -larch2-5a
> Build complete for project Proj1

> Some extra information about the project ...
> The folder C:LibArch contains the libarch2-5a library that i'm using.
> The folder C:ArchLib2-5a contains the source code for the library.
> The file dummest.C contains the main function, and all other files
> provided contain added functionality that will be used by dummest.C.

> If you need any additional information, let me know. Thanks for the help.

This is a managed project ... something seems to be very odd
Especially this line:
> g++: Proj1.exe: No such file or directory

Could you fire a PR, it is probably something that Sean should
take a look at.

> Michael Bildner


> > "alain" <alain@nowhere.ca> wrote in message
> > Post the output of the view call C-Build, it contains the trace
> > of the compilation.
> >
> > Was it with managed make or Standard make ?
Re: Using a Precompiled Library [message #89808 is a reply to message #89720] Tue, 16 December 2003 05:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mbildner.hotmail.com

"alain" <alain@nowhere.ca> wrote in message news:brleb7$nbr$1@eclipse.org...
> > Michael Bildner wrote:
> >
> > The project was a Managed Make project. Below is the output from the
> > C-Build view:
> >
> > make clean all
> > rm -rf dummest.o execute.o fetch_into.o globals.o
make_connections.o
> > run_simulation.o Proj1.exe
> > g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o dummest.o ../dummest.C
> > g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o execute.o ../execute.C
> > g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o fetch_into.o
> > .../fetch_into.C
> > g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o globals.o ../globals.C
> > g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o make_connections.o
> > .../make_connections.C
> > g++ -IC:ArchLib2-5a -O3 -gstabs -Wall -c -o run_simulation.o
> > .../run_simulation.C
> > g++: Proj1.exe: No such file or directory
> > make: *** [Proj1.exe] Error 1
> > g++ -LC:LibArch -o Proj1.exe dummest.o execute.o fetch_into.o
> > globals.o make_connections.o run_simulation.o -larch2-5a
> > Build complete for project Proj1
> >
> > Some extra information about the project ...
> > The folder C:LibArch contains the libarch2-5a library that i'm
using.
> > The folder C:ArchLib2-5a contains the source code for the library.
> > The file dummest.C contains the main function, and all other files
> > provided contain added functionality that will be used by dummest.C.
> >
> > If you need any additional information, let me know. Thanks for the
help.
> >
> > This is a managed project ... something seems to be very odd
> > Especially this line:
> > g++: Proj1.exe: No such file or directory
> >
>
> Could you fire a PR, it is probably something that Sean should
> take a look at.
>

Sorry, but I'm new to this. What is a PR and how would I go about firing
one ? Thanks.

Michael
Re: Using a Precompiled Library [message #90031 is a reply to message #89587] Wed, 17 December 2003 16:22 Go to previous message
Eclipse UserFriend
Michael Bildner wrote:
> The project was a Managed Make project. Below is the output from the
> C-Build view:

When you add directories in the project settings for include paths and
library paths, which contain backslashs, try adding them within double
quotes like:

"C:\Directory\lib"

Or try the way using '/' instead of '\'

c:/Directory/lib

Maybe this is the problem on the Proj1.exe linking line. The make and
compiler tools have their origin in Unix environments, though they
usually treat '\' as a line continuation.

> make clean all
> rm -rf dummest.o execute.o fetch_into.o globals.o make_connections.o
> run_simulation.o Proj1.exe
> g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o dummest.o ../dummest.C
> g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o execute.o ../execute.C
> g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o fetch_into.o
> ../fetch_into.C
> g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o globals.o ../globals.C
> g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o make_connections.o
> ../make_connections.C
> g++ -IC:\ArchLib2-5a -O3 -gstabs -Wall -c -o run_simulation.o
> ../run_simulation.C
> g++: Proj1.exe: No such file or directory
> make: *** [Proj1.exe] Error 1
> g++ -LC:\LibArch\ -o Proj1.exe dummest.o execute.o fetch_into.o
> globals.o make_connections.o run_simulation.o -larch2-5a
> Build complete for project Proj1
>
> Some extra information about the project ...
> The folder C:\LibArch contains the libarch2-5a library that i'm using.
> The folder C:\ArchLib2-5a contains the source code for the library.
> The file dummest.C contains the main function, and all other files
> provided contain added functionality that will be used by dummest.C.
>
> If you need any additional information, let me know. Thanks for the help.
>
> Michael Bildner
>
>
>
>>"alain" <alain@nowhere.ca> wrote in message
>>Post the output of the view call C-Build, it contains the trace
>>of the compilation.
>>
>>Was it with managed make or Standard make ?
>
>
>
Previous Topic:New Project creation problem
Next Topic:makefile problem. should be simple for advanced users
Goto Forum:
  


Current Time: Tue May 06 23:08:34 EDT 2025

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

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

Back to the top