unresolved external symbol _OPS_GetNumRemainingInputArgs

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

Moderators: silvia, selimgunay, Moderators

Post Reply
linguan118
Posts: 141
Joined: Sun Oct 03, 2010 11:36 pm
Location: Hong Kong

unresolved external symbol _OPS_GetNumRemainingInputArgs

Post by linguan118 » Thu Mar 17, 2016 5:43 am

Hello, fmk,
I am building a new material using my OpenSees developer folder. If I use the function OPS_GetNumRemainingInputArgs(), i got the following error:
error LNK2019: unresolved external symbol _OPS_GetNumRemainingInputArgs referenced in function _OPS_

it seems that my developer folder is very old, so I downloaded a new one, but got the following error:
fatal error C1083: Cannot open include file: 'bool.h': No such file or directory

I have no idea what is updated in the new developer folder. If I do not use OPS_GetNumRemainingInputArgs() in my old folder, it works fine.

Thank you!
Research Assistant Professor, The Hong Kong Polytechnic University
guanlin@polyu.edu.hk

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

Re: unresolved external symbol _OPS_GetNumRemainingInputArgs

Post by fmk » Thu Mar 17, 2016 9:03 am

what file is giving the error? in visual studio you should be able to click on the error to go to the file.

linguan118
Posts: 141
Joined: Sun Oct 03, 2010 11:36 pm
Location: Hong Kong

Re: unresolved external symbol _OPS_GetNumRemainingInputArgs

Post by linguan118 » Thu Mar 17, 2016 6:47 pm

Hi, fmk,
It is my new material cpp file. I used OPS_GetNumRemainingInputArgs() function to get the number of input parameters. When I double-click the error, it said "the system can not find the file specified"

Here is part of my code, which I think the error comes from. I am sure you can understand it easily.
#include <elementAPI.h>
#include "FRPConfinedConcrete02.h"

#include <Vector.h>
#include <Channel.h>
#include <math.h>
#include <float.h>

#ifdef _USRDLL
#define OPS_Export extern "C" _declspec(dllexport)
#elif _MACOSX
#define OPS_Export extern "C" __attribute__((visibility("default")))
#else
#define OPS_Export extern "C"
#endif

OPS_Export void *
OPS_Newmaterial(int argc,
const char **argv)
{
// Pointer to a uniaxial material that will be returned
UniaxialMaterial *theMaterial = 0;

int iData[1];
double dData[8];
int numData = 1;

if (OPS_GetIntInput(&numData, iData) != 0) {
opserr << "WARNING invalid uniaxialMaterial Newmaterial tag" << endln;
return 0;
}

int inputNum = OPS_GetNumRemainingInputArgs();

if (inputNum == 8){
if (OPS_GetDoubleInput(&inputNum, dData) != 0) {
opserr << "Invalid #args, want: uniaxialMaterial Newmaterial " << iData[0] << " fc0? ec0? Ec? fcc? ecu? ft? Ets? Unit?" << endln;
return 0;
}
theMaterial = new FRPConfinedConcrete02(iData[0], dData[0], dData[1], dData[2], dData[3], dData[4], dData[5], dData[6], (int)dData[7]);
}

if (theMaterial == 0) {
opserr << "WARNING could not create uniaxialMaterial " << iData[0] << endln;
return 0;
}

return theMaterial;
}
Research Assistant Professor, The Hong Kong Polytechnic University
guanlin@polyu.edu.hk

linguan118
Posts: 141
Joined: Sun Oct 03, 2010 11:36 pm
Location: Hong Kong

Re: unresolved external symbol _OPS_GetNumRemainingInputArgs

Post by linguan118 » Thu Mar 17, 2016 10:18 pm

Hi, fmk,
I have solved my problem. Here is how:
I downloaded the new developer folder from svn://peera.berkeley.edu/usr/local/svn/OpenSees/trunk/DEVELOPER
But it seems that "bool.h" is missing in the core folder. So i downloaded "bool.h" from the opensees SRC and copied in the core folder.
After that, it works fine.

Thank you anyway!
Research Assistant Professor, The Hong Kong Polytechnic University
guanlin@polyu.edu.hk

Post Reply