new material

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

Moderators: silvia, selimgunay, Moderators

Post Reply
eroz
Posts: 49
Joined: Wed Sep 14, 2005 7:47 am
Location: San Francisco

new material

Post by eroz »

Trying to incorporate my custom material. I am getting the following error during compiling:

openSees error LNK2019: unresolved external symbol "int __cdecl TclCommand_MYMaterial(void *,struct Tcl_Interp *,int,char const * *,class TclModelBuilder *)" (?TclCommand_MYMaterial@@YAHPAXPAUTcl_Interp@@HPAPBDPAVTclModelBuilder@@@Z) referenced in function "int __cdecl TclModelBuilderUniaxialMaterialCommand(void *,struct Tcl_Interp *,int,char const * *,class TclModelBuilder *,class Domain *)" (?TclModelBuilderUniaxialMaterialCommand@@YAHPAXPAUTcl_Interp@@HPAPBDPAVTclModelBuilder@@PAVDomain@@@Z)

where "MYMatrerial" is the name of the new material of concern. Probably did something wrong when making changes on the OpenSees Interpreter. Here were my steps:

1) assign material tag number (SRC--> classTags.h)

2) Under SRC-->material-->TclModelBuilderUniaxialMaterialCommand.cpp
a) added the line of code:
"#include <MYMaterial.h>"

b) added the line of code:
int TclCommand_MYMaterial(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv, TclModelBuilder *theTclBuilder);

c) added the line of code:
else if (strcmp(argv[1], "MYMaterial") == 0) { return TclCommand_MYMaterial(clientData,interp,argc,argv,theTclBuilder); }

3) Created the "MYMaterial.cpp" where int TclCommand_MYMaterial(.....) is, and placed it under SRC-->material-->uniaxial

Is the compile error regarding the above steps? Am I missing any additional tasks that need to be completed? Any help is much appreciated.

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

Post by fmk »

it is looking for the new procedure you say exists .. you have to add both the new
procedure and the class files to the project .. it is not enough that they be in the directory
structure .. in vc++ you need to add these files to the existing material project.
Post Reply