CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

"unresolved external symbol"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 27, 2011, 04:45
Default [solved]"unresolved external symbol"
  #1
New Member
 
Coiby Xu
Join Date: Jan 2011
Posts: 7
Rep Power: 15
coiby is on a distinguished road
I've fixed the problem. Thanks!

I write a proram for the purpose of user-defined initialization. But Fluent gives the error message when compiling it. Can anybody figure out the reason? Thanks!
Quote:
# Generating udf_names.c because of makefile my_init_func.obj
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj my_init_func.obj
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
Creating library libudf.lib and object libudf.exp
my_init_func.obj : error LNK2001: unresolved external symbol _ran
libudf.dll : fatal error LNK1120: 1 unresolved externals
Code:
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<udf.h>
#include<math.h>
#define K 4 //K nucleis per cell
#define mu 2.6 //expected value
#define sigma 8.0 // standard deviation
#define PI 3.1416926
#define maxi 10000000
float gauss(void)
{
 float tmp; //tmp value
 float u;
 float v;
 //float mu; // the expected value of Gauss Distrubution
 tmp=0;
 srand((unsigned)time(NULL));
 
 while(mu-2>tmp||tmp>mu+2){
  u=ran()*1.0/RAND_MAX;
  v=ran()*1.0/RAND_MAX;
  tmp=sqrt(-2*log(u))*cos(2*PI*v)*sigma+mu;
 }
 return tmp;
}
DEFINE_INIT(my_init_function, domain)
{
 cell_t c;
 Thread *t;
 int i; //loop control
 int j; //loop control
 //int cnum = domain->cell_count; // the total number of cells
 float *radius[maxi][K];
 j=0;
 thread_loop_c(t,domain)
 {
  for(i=0;i<K;i++)
   *radius[j][i]=gauss();
  j++;
 }
}

Last edited by coiby; January 27, 2011 at 06:09. Reason: problem fixed
coiby is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
External magnetic field data Richard Lee FLUENT 7 January 11, 2019 04:43
CGNS Compiling Diego Main CFD Forum 17 December 21, 2014 01:40
About External Emissivity Cloud FLUENT 4 June 27, 2013 02:16
Update boundary conditions calculated by an external program CedricVH OpenFOAM 2 January 15, 2010 11:55
Why I can't read one external file? Lee Siemens 7 April 2, 2004 12:25


All times are GMT -4. The time now is 23:36.