Dear all,
can you please help me to link a library to my project? I’m new with using eclipse and programming fortran. I have download eclipse and photran:
Eclipse for Parallel Application Developers
Version: Luna Service Release 2 (4.4.2)
Build id: 20150219-0600
It works so far. And I can compile a small “Hello World!” program without any problems. I want to use a library (name: libLChemApp.a) in my eclipse project. The same library works in a non-eclipse project on the same
machine without any problems. I have put the library in my workspace. My directory tree looks like this:
ca-test-2: <- project
-
lib <- here is the library
-
src
-
debug
-
release
Now I have to tell the compiler where the library is which I want to use. How can I do it?
I have tried:
Project->Properties
Fortran General->Paths and Symbols
Includes: Add…
Directory: /ca-test-2/lib
The options: ‘Add to all configurations’, ‘Add to all languages’ and ‘Is a workspace path’ are enabled.
Libraries: Add…
File: ${workspace_loc:/ca-test-2/lib/libLChemApp.a}
The options: ‘Add to all configurations’, ‘Add to all languages’ and ‘Is a workspace path’ are enabled.
If I build the project I get an error:
13:36:02 **** Incremental Build of configuration Debug for project ca-test-2 ****
make all
Building target: ca-test-2
Invoking: GNU Fortran Linker
gfortran -o "ca-test-2" ./src/ca.o -l"/home/verfurt/Schreibtisch/ws-f-calight-v642/ca-test-2/lib/libLChemApp.a"
/usr/bin/ld: cannot find -l/home/verfurt/Schreibtisch/ws-f-calight-v642/ca-test-2/lib/libLChemApp.a
collect2: Fehler: ld gab 1 als Ende-Status zurück
make: *** [ca-test-2] Fehler 1
13:36:02 Build Finished (took 231ms)
But the library is in the workspace. Why cannot the compiler find it? What do I do wrong?
With best regards,
Viktoria