Difficulty linking to libOpenSees.a

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
MatthewPeavy
Posts: 10
Joined: Sat Mar 15, 2008 6:33 am
Location: ULB

Difficulty linking to libOpenSees.a

Post by MatthewPeavy »

I am having trouble linking to the libOpenSees.a library.

Specifics:
OpenSees version 2.2.0 (CVS head)
OS: Ubuntu 09.10
Compiler: gcc 4.4.1
Tcl/tk: 8.5

The makefile.def was taken mostly from the Makefile.def.gcc4.1.1. I updated for the TCL version (-D_TCL85). PROGRAMMING_MODE = SEQUENTIAL.

The library builds fine. I get a libOpenSees.a and an OpenSees.exe binary, as expected. The binary runs.

The problem comes when I try to link to libOpenSees.a. I get the following errors:

OpenSees_Build/Build/Linux_Build/Release/libOpenSees.a(TclPatternCommand.o): In function `TclPatternCommand(void*, Tcl_Interp*, int, char const**, Domain*)':
TclPatternCommand.cpp:(.text+0x22f): undefined reference to `getInterpPWD(Tcl_Interp*)'
TclPatternCommand.cpp:(.text+0x23c): undefined reference to `simulationInfo'
OpenSees_Build/Build/Linux_Build/Release/libOpenSees.a(TclSeriesCommand.o): In function `TclTimeSeriesCommand(void*, Tcl_Interp*, int, char const**, Domain*)':
TclSeriesCommand.cpp:(.text+0x5cc): undefined reference to `getInterpPWD(Tcl_Interp*)'
TclSeriesCommand.cpp:(.text+0x5d9): undefined reference to `simulationInfo'
TclSeriesCommand.cpp:(.text+0x5f7): undefined reference to `simulationInfo'
TclSeriesCommand.cpp:(.text+0xbef): undefined reference to `getInterpPWD(Tcl_Interp*)'
TclSeriesCommand.cpp:(.text+0xbf9): undefined reference to `simulationInfo'
TclSeriesCommand.cpp:(.text+0xcaa): undefined reference to `getInterpPWD(Tcl_Interp*)'
TclSeriesCommand.cpp:(.text+0xcb4): undefined reference to `simulationInfo'

----

I see that Tcl_Interp and simulationInfo are declared extern within TclSeriesCommand.cpp, and the actual definition is given in commands.cpp. The commands.cpp file gets compiled (there is an .o object file).

I was building and linking using essentially the same code against OpenSees 2.0.0 using gcc 4.1.

So I started to wonder if it was a "stricter" compiler issue.

Any ideas?

Thanks,
Matt.
Post Reply