C语言访问有限元软件数据库时出现如下错误,怎么解决?

错误如下:
-------------------Configuration: CAccessCalls - Win32 Debug--------------------
Linking...
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbCloseDatabase
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbOpenDatabase
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbFGetNodes
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbFGetNodeIds
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbFCountNode
.......
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbGetMaterialPropValueCount
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbFGetMaterial
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbFGetAllRegionIds
CAccessCalls.obj : error LNK2001: unresolved external symbol _DbFCountRegionIds
Debug/CAccessCalls.exe : fatal error LNK1120: 25 unresolved externals
执行 link.exe 时出错.
CAccessCalls.exe - 1 error(s), 0 warning(s)
源程序如下:
#include "stdio.h"
#include "malloc.h"
#include "iostream.h"
int main(int argc, char argv[])
{
//define
int status = 1;
//function
int Coor0_func();
int Elem0_func();
int Disp0_Id0_func();
int Material_func(FILE *file);
status=DbOpenDatabase(argv[1]);

if (status != 0 )
{
printf("Error open patran file:%s \n",argv[1]);
return(status);
}
else
{
printf("Success open the patran file\n\n");

Coor0_func();

Elem0_func();
Disp0_Id0_func();
if(0==DbCloseDatabase())
{
printf("Success close patran file\n\n\n\n");
printf("
**You can find the four files (Coor0.dat;Disp0.dat;Elem0.dat;Id0.dat)in c:\*** ");
}

}

return(0);
}
int Coor0_func()
{
FILE * file_coor0;
int status;
long i,num_nodes,*node_ids,*ref_coords,*analy_coords;
float glob_xyz,*temp;
//create file: coor0.dat
if((file_coor0=fopen("c:\Coor0.dat","wt"))==NULL)
{
printf("Error open coor0.dat \n");
return 0 ;
}
//read data from database
printf("read data information from database.....\n\n");
if(DbFCountNodes(&num_nodes)==1)return 0;
printf("$$the number of nodes is %d\n",num_nodes);
fprintf(file_coor0,"%d %d\n",num_nodes,3);
node_ids=(long *)calloc(num_nodes,sizeof(long));
ref_coords=(long *)calloc(num_nodes,sizeof(long));
analy_coords=(long *)calloc(num_nodes,sizeof(long));
glob_xyz=(double *)calloc(num_nodes*3,sizeof(double));
temp=glob_xyz;
status=DbFGetNodeIds(num_nodes,node_ids);
status=DbFGetNodes( num_nodes,node_ids,ref_coords,analy_coords,glob_xyz);
for(i=0;i<num_nodes;i++)
{
fprintf(file_coor0,"%E %E %E \n",
(temp+i*3),*(temp+i*3+1),*(temp+i*3+2));
}
free(node_ids);
free(ref_coords);
free(analy_coords);
free(glob_xyz);

rintf("File:coor0.dat has finished\n");
return 0;
}
int Elem0_func()
{
FILE *file_elem0;
int status,hex_8_noded, tri_4_noded;
long i, num_elems,*elem_ids,*region_ids,*elem_topo_codes,*elem_4_nodes,*elem_8_nodes,actual_num_elems, current_topo_code;
long int_4_array[5], int_8_array[9],num_words, max_num_words, *word_ids;
long ;
int shape_code[2], nodes_per_elem[2],current_region, thick_field, material_id,num_codes;
float thickness;
int prop_set_id, dof_set_flag, condense_flag, geom_flag, form_flag,lam_flag, layer_count, material_lin, material_dir;
char prop_set_name[32];

 material_id=0;
 //create files
if((file_elem0=fopen("c:\\Elem0.dat","wt"))==NULL)
   {
       printf("Error open Elem0.dat \n");
       return 0 ;
   }

......

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问