Greetings
I'm not a C Programmer, but due to circumstances beyond my control
I've been called on to compile a shared lib as an UserDefined function
for a CFD product.
I keep getting error LNK2001 when I try and compile.
Error 1 error LNK2001: unresolved external symbol ucfunc uclib.obj
Error 2 error LNK2001: unresolved external symbol ucarg uclib.obj
Error 3 fatal error LNK1120: 2 unresolved externals ...\x64\Release
\StarTimeAvg.dll
There are 4 files in total, two .c (tav.c, uclib.c) and two .h
(real.h, uclib.h)
I'm fairly certain the problem is in one of the uclib files. It's
probably something totally simple but after hours looking for help via
google I'm no closer to a solution than when i started.
Any help is deeply appreciated.
####
uclib.h
####
#ifndef UCLIB_H
#define UCLIB_H
#include "Real.h"
#ifdef __cplusplus
extern "C" {
#endif
#define USERFUNCTION_EXPORT __declspec(dllexport)
#define USERFUNCTION_IMPORT __declspec(dllimport)
USERFUNCTION_EXPORT extern void ucarg(void *, char *, char *, int);
USERFUNCTION_EXPORT extern void ucfunc(void *, char *, char *);
USERFUNCTION_EXPORT extern void ucfunction(void *, char *, char *,
int, ...);
void USERFUNCTION_EXPORT uclib();
#ifdef __cplusplus
}
#endif
#endif
###
uclib.c
###
#include "uclib.h"
void tav(Real*, int, Real*, Real*, Real*,CoordReal*);
void
uclib()
{
/* Register user functions here */
ucfunc(tav, "RegionProfile", "Time-Averaging");
ucarg(tav, "Cell", "U_Velocity", sizeof(Real));
ucarg(tav, "Cell", "V_Velocity", sizeof(Real));
ucarg(tav, "Cell", "W_Velocity", sizeof(Real));
ucarg(tav, "Cell", "Centroid", sizeof(CoordReal[3]));
}