Error building PlaneFrame example

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

Error building PlaneFrame example

Post by MatthewPeavy »

Frank, all -

I get an error while building the PlaneFrame example. [I think this error may be related to my previous post of linking to the libOpenSees.a library, which wasn't resolved.]

I have compiled the CVS head version. It builds into the libOpenSees.a and OpenSees executable which runs. When I try to build the PlaneFrame, I get the following error:

main.cpp:63: error: cannot declare pointer to ‘class OPS_Stream&’
main.cpp:63: error: cannot convert ‘StandardStream’ to ‘OPS_Stream*’ in initialization
make: *** [main.o] Error 1

I get the same error whether building against TCL/TK 8.4 or 8.5.

I am building for sequential. Using graphics or not doesn't seem to change anything.

I am using Ubuntu 09.10 on a dual-core x86-64, with gcc-4.4.1.

Do you have any idea how to resolve this?

I am wondering if others have compiled and run using gcc-4.4?

Thanks for your help,
Matt.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

you need something like the following

[code]
#include <OPS_Globals.h>
#include <StandardStream.h>

StandardStream sserr;
OPS_Stream *opserrPtr = &sserr;
[/code]
MatthewPeavy
Posts: 10
Joined: Sat Mar 15, 2008 6:33 am
Location: ULB

Post by MatthewPeavy »

Frank,

I made that changes, which allowed the file to compile the file.

But I get 2 different kinds of link errors: a multiple definition and some undefined references.

Thanks for your help,
Matt.


/home/matthew/Programming/PhD/OpenSees/lib/libOpenSees.a(Domain.o):(.bss+0x0): multiple definition of `ops_TheActiveDomain'
main.o:(.bss+0x238): first defined here

/home/matthew/Programming/PhD/OpenSees/lib/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'
/home/matthew/Programming/PhD/OpenSees/lib/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'
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

if you want it quick .. you can probably ignore the warnings and go into the Tcl files and remove the reference to simulationInfo and getInterpPWD()
MatthewPeavy
Posts: 10
Joined: Sat Mar 15, 2008 6:33 am
Location: ULB

Post by MatthewPeavy »

That does work for a quick fix.

Do you have any idea what why I get the error when nobody else seems to? I'd like to help find a more permanent solution than commenting out code from the main trunk.

Thanks again,
Matt.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

nobody else builds their own application .. they are all adding directly to the OpenSees tcl interpreters.
Post Reply