我已经从SBIG网站下载了这个C代码,以便控制(拍照并保存)我从他们那里购买的相机(型号ST-401ME).我有一个需要调用它的Matlab程序,所以我试图用它的头和库编译(用Visual Studio)这个代码到一个可执行文件中.但是,当我尝试时,我得到上述错误.请注意,我已将包含库的文件添加到目录路径中.
输出的确切措辞是这样的:
1>------ Build started: Project: CaptureImage,Configuration: DeBUG Win32 ------1>Compiling...1>main.cpp1>linking...1>csbigcam.obj : error LNK2019: unresolved external symbol _SBIGUnivDrvCommand@12 referenced in function "public: enum PAR_ERROR __thiscall CSBIGCam::SBIGUnivDrvCommand(short,voID *,voID *)" (?SBIGUnivDrvCommand@CSBIGCam@@QAE?AW4PAR_ERROR@@Fpax0@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffclos referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::SaveFITS(char const *)" (?SaveFITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffprec referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::SaveFITS(char const *)" (?SaveFITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffpky referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::SaveFITS(char const *)" (?SaveFITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffuky referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::SaveFITS(char const *)" (?SaveFITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffppr referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::SaveFITS(char const *)" (?SaveFITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffcrim referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::SaveFITS(char const *)" (?SaveFITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffinit referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::SaveFITS(char const *)" (?SaveFITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffphis referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::History2FITS(struct fitsfile *)" (?History2FITS@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PAUfitsfile@@@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffmrhd referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffgrec referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffghsp referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffghdn referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffgkyj referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffgkyd referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffgkys referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffgpxv referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffgipr referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>csbigimg.obj : error LNK2019: unresolved external symbol _ffopen referenced in function "public: enum SBIG_file_ERROR __thiscall CSBIGimg::ReadFITSImage(char const *)" (?ReadFITSImage@CSBIGimg@@QAE?AW4SBIG_file_ERROR@@PBD@Z)1>I:\My documents\Visual Studio 2008\Projects\CaptureImage\DeBUG\CaptureImage.exe : Fatal error LNK1120: 19 unresolved externals1>Build log was saved at "file://i:\My documents\Visual Studio 2008\Projects\CaptureImage\CaptureImage\DeBUG\BuildLog.htm"1>CaptureImage - 20 error(s),0 warning(s)========== Build: 0 succeeded,1 Failed,0 up-to-date,0 skipped ==========
我认为这与链接库有关.我从来没有在Visual Studio中学会过如何做到这一点,而且我在大学读取的课程是在5年前,所以我几乎没有记住任何东西.
由于代码的长度,我只会错误地发生错误的部分.如果您想要更多(如主要),请告诉我.
码:
csbigcam.cpp
#include "lpardrv.h"#include "sbigudrv.h"#include "csbigcam.h"#include "csbigimg.h"#include <string>#include <math.h>using namespace std;#ifndef INVALID_HANDLE_VALUE#define INVALID_HANDLE_VALUE -1#endif#define VERSION_STR "1.2" /* version of this class *//* Temperature Conversion Constants defined in the SBIG Universal Driver documentation*/#define T0 25.0#define R0 3.0#define DT_CCD 25.0#define DT_AMB 45.0#define RR_CCD 2.57#define RR_AMB 7.791#define RB_CCD 10.0#define RB_AMB 3.0#define MAX_AD 4096...PAR_ERROR CSBIGCam::GetFullFrame(int &nWIDth,int &nHeight){ GetCCDInfoResults0 gcir; GetCCDInfoParams gcip; unsigned short vertNBinning; unsigned short rm; // Get the image dimensions vertNBinning = m_uReadoutMode >> 8; if ( vertNBinning == 0 ) vertNBinning = 1; rm = m_uReadoutMode & 0xFF; gcip.request = (m_eActiveCCD == CCD_IMAGING ? CCD_INFO_IMAGING : CCD_INFO_TRACKING); if ( SBIGUnivDrvCommand(CC_GET_CCD_INFO,&gcip,&gcir) != CE_NO_ERROR ) return m_eLastError; if ( rm >= gcir.readoutModes ) return CE_BAD_ParaMETER; nWIDth = gcir.readoutInfo[rm].wIDth; if ( rm >=3 && rm <= 5 ) nHeight = gcir.readoutInfo[rm-3].height / vertNBinning; else nHeight = gcir.readoutInfo[rm].height / vertNBinning; return CE_NO_ERROR;}...
csbigcam.h
#ifndef _CSBIGCAM_#define _CSBIGCAM_#ifndef _PARDRV_ #include "sbigudrv.h"#endif#ifndef _CSBIGimg_ #include "csbigimg.h"#endif#include <string>using namespace std;typedef enum {RELAY_XPLUS,RELAY_XMINUS,RELAY_YPLUS,RELAY_YMINUS } CAMERA_RELAY;typedef enum {SBDF_liGHT_ONLY,SBDF_DARK_ONLY,SBDF_DARK_ALSO } SBIG_DARK_FRAME;typedef enum {GS_IDLE,GS_DAWN,GS_EXPOSING_DARK,GS_DIGITIZING_DARK,GS_EXPOSING_liGHT,GS_DIGITIZING_liGHT,GS_DUSK } GRAB_STATE;class CSBIGCam {private: PAR_ERROR m_eLastError; PAR_COMMAND m_eLastCommand; short m_nDrvHandle; CAMERA_TYPE m_eCameraType; CCD_REQUEST m_eActiveCCD; double m_dExposureTime; unsigned short m_uReadoutMode; ABG_STATE7 m_eABGState; int m_nSubFrameleft,m_nSubFrametop,m_nSubFrameWIDth,m_nSubFrameHeight; GRAB_STATE m_eGrabState; double m_dGrabPercent; CFW_MODEL_SELECT m_eCFWModel; CFW_ERROR m_eCFWError; struct { unsigned short vertNBinning,hBin,vBin; unsigned short rm; int left,top,wIDth,height; } m_sGrabinfo;public: // Constructors/Destructors CSBIGCam(); CSBIGCam(OpenDeviceParams odp); CSBIGCam(SBIG_DEVICE_TYPE dev); ~CSBIGCam(); voID Init(); // Error Reporting Routines PAR_ERROR GetError(); string GetErrorString(); string GetErrorString(PAR_ERROR err); PAR_COMMAND GetCommand(); // Accessor Functions double GetExposureTime(voID) { return m_dExposureTime; } voID SetExposureTime(double exp) { m_dExposureTime = exp; } CCD_REQUEST GetActiveCCD(voID) { return m_eActiveCCD; } voID SetActiveCCD(CCD_REQUEST ccd) { m_eActiveCCD = ccd; } unsigned short GetReadoutMode(voID) { return m_uReadoutMode; } voID SetReadoutMode(unsigned short rm) { m_uReadoutMode = rm; } CAMERA_TYPE GetCameraType(voID) { return m_eCameraType; } ABG_STATE7 GetABGState(voID) { return m_eABGState; } voID SetABGState(ABG_STATE7 abgState) { m_eABGState = abgState; } voID SetSubFrame(int nleft,int ntop,int nWIDth,int nHeight); voID GetSubFrame(int &nleft,int &ntop,int &nWIDth,int &nHeight); PAR_ERROR GetReadoutInfo(double &pixelWIDth,double &pixelHeight,double &eGain); // Driver/Device Routines PAR_ERROR OpenDriver(); PAR_ERROR CloseDriver(); PAR_ERROR OpenDevice(OpenDeviceParams odp); PAR_ERROR CloseDevice(); PAR_ERROR GetDriverInfo(DRIVER_REQUEST request,GetDriverInfoResults0 &gdir); // High-Level Exposure Related Commands PAR_ERROR GrabSetup(CSBIGimg *pimg,SBIG_DARK_FRAME dark); PAR_ERROR GrabMain(CSBIGimg *pimg,SBIG_DARK_FRAME dark); PAR_ERROR GrabImage(CSBIGimg *pimg,SBIG_DARK_FRAME dark); voID GetGrabState(GRAB_STATE &grabState,double &percentComplete); // Low-Level Exposure Related Commands PAR_ERROR StartExposure(SHUTTER_COMMAND shutterState); PAR_ERROR EndExposure(voID); PAR_ERROR IsExposureComplete(MY_LOGICAL &complete); PAR_ERROR StartReadout(StartReadoutParams srp); PAR_ERROR EndReadout(voID); PAR_ERROR Readoutline(ReadoutlineParams rlp,MY_LOGICAL darkSubtract,unsigned short *dest); PAR_ERROR Dumplines(unsigned short nolines); //Temperature Related Commands PAR_ERROR GetCCDTemperature(double &ccdTemp); PAR_ERROR SetTemperatureRegulation(MY_LOGICAL enable,double setpoint); PAR_ERROR queryTemperatureStatus(MY_LOGICAL &enabled,double &ccdTemp,double &setpointTemp,double &percentTE); // Control Related Commands PAR_ERROR ActivateRelay(CAMERA_RELAY relay,double time); PAR_ERROR IsRelayActive(CAMERA_RELAY relay,MY_LOGICAL &active); PAR_ERROR AOTipTilt(AOTipTiltParams attp); PAR_ERROR CFWCommand(CFWParams cfwp,CFWResults &cfwr); // General Purpose Commands PAR_ERROR Establishlink(voID); string GetCameraTypestring(voID); PAR_ERROR GetFullFrame(int &nWIDth,int &nHeight); PAR_ERROR GetFormattedCameraInfo(string &ciStr,MY_LOGICAL HTMLFormat = TRUE); // Utility functions MY_LOGICAL Checklink(voID); unsigned short degreesCToAD(double degC,MY_LOGICAL ccd = TRUE); double ADTodegreesC(unsigned short ad,MY_LOGICAL ccd = TRUE); //CFW Functions CFW_MODEL_SELECT GetCFWModel(voID) { return m_eCFWModel; } PAR_ERROR SetCFWModel(CFW_MODEL_SELECT cfwModel,CFW_COM_PORT comPort = CFWPORT_COM1); PAR_ERROR SetCFWposition(CFW_position position); PAR_ERROR GetCFWpositionAndStatus(CFW_position &position,CFW_STATUS &status); PAR_ERROR GetCFWMaxposition(CFW_position &position); CFW_ERROR GetCFWError(voID) { return m_eCFWError; } string GetCFWErrorString(CFW_ERROR err); string GetCFWErrorString(voID); // Allows access directly to driver PAR_ERROR SBIGUnivDrvCommand(short command,voID *Params,voID *Results);};#endif /* #ifndef _CSBIGCAM_ */
csbigimg.ccp
#include "lpardrv.h"#include "csbigimg.h"#include <stdio.h>#include <string.h>#include <string>/* Local Constants*/#if TARGET == ENV_MACOSX #define LONGLONG long long#endif#define file_VERSION 3 /* current header version written */#define DATA_VERSION 1 /* current data version written */#define header_LEN 2048#define VERSION_STR "1.2" /* version of this class */static const char *header_KEYWORDS[] ={ "file_version = ","Data_version = ","Exposure = ","Focal_length = ","Aperture = ","Response_factor = ","Note = ","Background = ","Range = ","Height = ","WIDth = ","Date = ","Time = ","Exposure_state = ","Temperature = ","Number_exposures = ","Each_exposure = ","History = ","Observer = ","X_pixel_size = ","Y_pixel_size = ","Pedestal = ","E_gain = ","User_1 = ","User_2 = ","User_3 = ","User_4 = ","Filter = ","Readout_mode = ","Track_time = ","Sat_level = ","End"};typedef enum{ HH_file_VERSION,HH_DATA_VERSION,HH_EXPOSURE,HH_FOCAL_LENGTH,HH_APERTURE,HH_RESPONSE_FACTOR,HH_NOTE,HH_BACKGROUND,HH_RANGE,HH_HEIGHT,HH_WIDTH,HH_DATE,HH_TIME,HH_EXPOSURE_STATE,HH_TEMPERATURE,HH_NUMBER_EXPOSURES,HH_EACH_EXPOSURE,HH_HISTORY,HH_OBSERVER,HH_X_PIXEL_SIZE,HH_Y_PIXEL_SIZE,HH_PEDESTAL,HH_E_GAIN,HH_USER_1,HH_USER_2,HH_USER_3,HH_USER_4,HH_FILTER,HH_READOUT_MODE,HH_TRACK_TIME,HH_SAT_LEVEL,HH_END} SBIG_header_heading;...#if INCLUDE_FITSIO /* save file in FITS format */ res = SaveFITS(pFullPath);#else...SBIG_file_ERROR CSBIGimg::History2FITS(fitsfile *fptr){ int status = 0; const char *msg,*p; char c,*cp = (char*)m_cHistory.c_str(); int index; MY_LOGICAL first = TRUE; while (*cp) { c = *cp++; if ( (p=strchr(HISTORY_CHARS,c)) != NulL ) { index = (p - HISTORY_CHARS)/sizeof(const char); msg = HISTORY_PHRASES[index]; } else if ( c == '0' ) continue; else msg = "???"; if ( first ) fits_write_key(fptr,TSTRING,"SWMODIFY",(voID *)m_cSoftware.c_str(),"",&status); first = FALSE; if (fits_write_history(fptr,msg,&status)) { return SBFE_FITS_header_ERROR; } } return SBFE_NO_ERROR;}...SBIG_file_ERROR CSBIGimg::ReadFITSImage(char const *pFullPath){SBIG_file_ERROR err = SBFE_FORMAT_ERROR;fitsfile *fptr; /* FITS file pointer,defined in fitsio.h */char card[FLEN_CARD]; /* Standard string lengths defined in fitsio.h */int status = 0; /* CFITSIO status value MUST be initialized to zero! */int hdupos,nkeys,ii,jj;int bitpix,naxis;long naxes[2] = {1,1},fpixel[2] = {1,1};unsigned short *uip;long l,l2;double d;char s[80];MY_LOGICAL first = TRUE;struct tm obs;if (!fits_open_file(&fptr,pFullPath,Readonly,&status)){ do { // Allow to break out // get and check the dimensions if ( fits_get_img_param(fptr,2,&bitpix,&naxis,naxes,&status) ) break; if ( bitpix != 16 || naxis != 2 ) break; // allocate the buffer err = SBFE_MEMORY_ERROR; if ( !AllocateImageBuffer(naxes[1],naxes[0]) ) break; uip = GetimagePointer(); // read the image data err = SBFE_READ_ERROR; if ( fits_read_pix(fptr,TUSHORT,fpixel,naxes[0]*naxes[1],NulL,uip,&status) ) break; // try and read the SBIG keys status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_OBJ],s,&status) ) SetFITSObject(s); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_ScopE],&status) ) SetFITSTelescope(s); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_INST],&status) ) SetCameraModel(s); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_OBS],&status) ) Setobserver(s); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_DATEOBS],&status) ) { if ( sscanf(s,"%4d-%2d-%2dT%2d.%2d.%2d",&obs.tm_year,&obs.tm_mon,&obs.tm_mday,&obs.tm_hour,&obs.tm_min,&obs.tm_sec) == 6 ) { obs.tm_year -= 1900; obs.tm_mon -= 1; memcpy(&m_sDecodedImageStartTime,&obs,sizeof(struct tm)); } } status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_EXP],&d,&status) ) SetExposureTime(d); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_CCDT],&status) ) SetCCDTemperature(d); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_PIXX],&status) ) SetPixelWIDth(d/1000.0); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_PIXY],&status) ) SetPixelHeight(d/1000.0); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_BINX],&l,&status) && !fits_read_key_lng(fptr,FITS_KEYS[FK_BINY],&l2,&status) ) SetBinning((unsigned short)l,(unsigned short)l2); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_ORGX],FITS_KEYS[FK_ORGY],&status) ) SetSubFrame((unsigned short)l,(unsigned short)l2); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_EGAIN],&status) ) SetEGain(d); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_FL],&status) ) SetFocalLength(d/25.4); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_APTD],&status) ) SetApertureDiameter(d/25.4); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_APTA],&status) ) SetApertureArea(d/25.4/25.4); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_BLACK],&status) ) SetBackground(l); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_WHITE],&status) ) SetRange(l - GetBackground()); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_PED],&status) ) SetPedestal((unsigned short)(l+100)); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_MAX],&status) ) SetSaturationLevel((unsigned short)l); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_SWA],&status) ) SetSoftware(s); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_FILT],&status) ) SetFilter(s); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_SNAP],&status) ) SetNumberExposures((unsigned short)l); SetEachExposure(GetExposureTime()/l); status = 0; if ( !fits_read_key_lng(fptr,FITS_KEYS[FK_RES],&status) ) SetReadoutMode((unsigned short)l); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_EXPST],&status) && sscanf(s,"%lX",&l) == 1 ) SetExposureState((unsigned short)l); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_RESP],&status) ) SetResponseFactor(d); status = 0; if ( !fits_read_key_str(fptr,FITS_KEYS[FK_NOTE],&status) ) SetimageNote(s); status = 0; if ( !fits_read_key_dbl(fptr,FITS_KEYS[FK_TRAK],&status) ) SetTrackExposure(d); status = 0; // read and filter out the parsed keywords fits_get_hdu_num(fptr,&hdupos); /* Get the current HDU position */ for (; !status; hdupos++) /* Main loop through each extension */ { fits_get_hdrspace(fptr,&nkeys,&status); /* get # of keywords */ for (ii = 1; ii <= nkeys; ii++) { /* Read and print each keywords */ if (fits_read_record(fptr,card,&status)) break; for (jj=0; jj<FK_NEXT; jj++) { l = strlen(FITS_KEYS[jj]); if ( strncmp(card,FITS_KEYS[jj],l) == 0 ) break; } if ( jj == FK_NEXT ) { if ( !first ) m_cAdditionalFITSKeys += "\r"; m_cAdditionalFITSKeys += card ; first = FALSE; } } fits_movrel_hdu(fptr,1,&status); /* try to move to next HDU */ } if (status == END_OF_file) status = 0; /* reset after normal error */ if ( status ) break; // got here so there was no error err = SBFE_NO_ERROR; m_nDefaultimageFormat = SBIF_FITS; } while ( FALSE ); fits_close_file(fptr,&status);}if (err == SBFE_NO_ERROR && status) err = SBFE_FORMAT_ERROR;if ( err != SBFE_NO_ERROR ) DeleteImageData();return(err);}#endif
csbigimg.h
#ifndef _CSBIGimg_ #define _CSBIGimg_/* Compile Time Options*/ #define INCLUDE_FITSIO 1 /* set to 1 to compile and link with FITSIO library */ #ifndef _LPARDRV_ #include "lpardrv.h" #endif #include <time.h> #include <string>using namespace std; #if INCLUDE_FITSIO #include "fitsio.h" #endif /* INCLUDE_FITSIO */#ifndef PI #define PI 3.1415926535#endif/* Exposure State FIEld defines*/ #define ES_ABG_MASK 0x0003 #define ES_ABG_UNKNowN 0x0000 #define ES_ABG_LOW 0x0001 #define ES_ABG_CLOCKED 0x0002 #define ES_ABG_MID 0x0003 #define ES_ABG_RATE_MASK 0x00C0 #define ES_ABG_RATE_FIXED 0x0000 #define ES_ABG_RATE_LOW 0x0040 #define ES_ABG_RATE_MED 0x0080 #define ES_ABG_RATE_HI 0x00C0 #define ES_DCS_MASK 0x000c #define ES_DCS_UNKNowN 0x0000 #define ES_DCS_ENABLED 0x0004 #define ES_DCS_Disabled 0x0008 #define ES_DCR_MASK 0x0030 #define ES_DCR_UNKNowN 0x0000 #define ES_DCR_ENABLED 0x0010 #define ES_DCR_Disabled 0x0020 #define ES_autoBIAS_MASK 0x0100 #define ES_autoBIAS_ENABLED 0x0100 #define ES_autoBIAS_Disabled 0x0000typedef enum { SBIF_COMpressed,SBIF_UNCOMpressed,SBIF_FITS,SBIF_DEFAulT } SBIG_IMAGE_FORMAT;typedef enum{ SBFE_NO_ERROR,SBFE_OPEN_ERROR,SBRE_CLOSE_ERROR,SBFE_READ_ERROR,SBFE_WRITE_ERROR,SBFE_FORMAT_ERROR,SBFE_MEMORY_ERROR,SBFE_FITS_header_ERROR,SBFE_WRONG_SIZE,SBFE_NEXT_ERROR} SBIG_file_ERROR;class CSBIGimg{/* */private: int m_nHeight,m_nWIDth; // image size in pixels int m_nSubFrametop,m_nSubFrameleft;// for partial frames the top-left pixel unsigned short *m_pImage; // pointer to image data double m_dCCDTemperature; // CCD Temp at start of exposure double m_dExposureTime; // Exposure time in seconds double m_dTrackExposure; // Exposure when tracking double m_dEachExposure; // Snapshot time in seconds double m_dFocalLength; // Lens/Telescope Focal Length in inches double m_dApertureArea; // Lens/Telescope Aperture Are in Sq-Inches double m_dResponseFactor; // Magnitude Calibration Factor double m_dPixelHeight,m_dPixelWIDth; // Pixel Dimensions in mm double m_dEGain; // Electronic Gain,e-/ADU long m_lBackground,m_lRange; // display Background and Range unsigned short m_uNumberExposures; // Number of exposures co-added unsigned short m_uSaturationLevel; // Pixels at this level are saturated unsigned short m_uPedestal; // Image Pedestal unsigned short m_uExposureState; // Exposure State unsigned short m_uReadoutMode; // Camera Readout Mode use to acquire image unsigned short m_uHorizontalBinning; // Binning used in X unsigned short m_uVerticalBinning; // Binning used in Y string m_cImageNote; // Note attached to image string m_cObserver; // Observer name string m_cHistory; // Image History string of modification chars string m_cFilter; // Filter name imaged through string m_cSoftware; // Software App name and Version string m_cCameraModel; // Model of camera used to acquire image int m_isCompressed; // clc MY_LOGICAL m_bImageModifIEd; // True when modifIEd and not saved SBIG_IMAGE_FORMAT m_nDefaultimageFormat; // default image format for Saves struct tm m_sDecodedImageStartTime; // Decoded time light exposure started MY_LOGICAL m_bImageCanClose; // TRUE when image can be closed,FALSE if owned by // a CSBIGCam object and acquiring data/* */public: /* Constructors/Destructor */ CSBIGimg(voID); CSBIGimg(int height,int wIDth); ~ CSBIGimg(voID); voID Init(voID); voID DeleteImageData(voID);... /* More Accessor Functions */ voID SetimageStartTime(voID); voID SetimageStartTime(time_t startTime); voID SetimageStartTime(int mon,int dd,int yy,int hr,int min,int sec); voID SetimageStartTime(struct tm *pStartTime); voID SetSubFrame(int nleft,int ntop); voID GetSubFrame(int &nleft,int &ntop); voID SetBinning(unsigned short nHoriz,unsigned short nVert); voID GetBinning(unsigned short &nHoriz,unsigned short &nVert); voID AddHistory(string str); /* file IO Routines */ SBIG_file_ERROR SaveImage(const char *pFullPath,SBIG_IMAGE_FORMAT fmt = SBIF_DEFAulT); SBIG_file_ERROR OpenImage(const char *pFullPath); /* Utility Functions */ MY_LOGICAL AllocateImageBuffer(int height,int wIDth); voID CreateSBIGheader(char *pheader,MY_LOGICAL isCompressed); MY_LOGICAL Parseheader(char *pheader,MY_LOGICAL &isCompressed); SBIG_file_ERROR SaveCompressedImage(const char *pFullPath,char *pheader); SBIG_file_ERROR ReadCompressedImage(file *fh); SBIG_file_ERROR SaveUncompressedImage(const char *pFullPath,char *pheader); SBIG_file_ERROR ReadUncompressedImage(file *fh); int CompressSBIGData(unsigned char *pCmpData,int imgRow); voID IntelcopyBytes(unsigned char *pRevData,int imgRow); voID autoBackgroundAndRange(voID); string GetfileErrorString(SBIG_file_ERROR err); unsigned short GetAveragePixelValue(voID); unsigned short GetAveragePixelValue(int left,int top,int wIDth,int height); voID GetFormattedImageInfo(string &IIStr,MY_LOGICAL HTMLFormat = TRUE); /* Image Processing Funcions */ voID VerticalFlip(voID); voID HorizontalFlip(voID); SBIG_file_ERROR DarkSubtract(CSBIGimg *pimg); SBIG_file_ERROR FlatFIEld(CSBIGimg *pimg); /* color Image Processing */ voID RemoveBayercolor(voID);#if INCLUDE_FITSIOprivate: string m_cFITSObject; // name of object in FITS header string m_cFITSTelescope; // name of telescope in FITS header double m_dApertureDiameter; // Diameter of telescope string m_cAdditionalFITSKeys; // additional FITS keywordspublic: /* FITS Accessor functions */ voID SetFITSObject(string str) { m_cFITSObject = str; } string GetFITSObject(voID) { return m_cFITSObject;} voID SetFITSTelescope(string str) { m_cFITSTelescope = str; } string GetFITSTelescope(voID) { return m_cFITSTelescope;} voID SetApertureDiameter(double ap) { m_dApertureDiameter = ap; } double GetApertureDiameter(voID) { return m_dApertureDiameter; } voID SetAdditionalFITSKeys(string str) { m_cAdditionalFITSKeys = str; } string GetAdditionalFITSKeys(voID) { return m_cAdditionalFITSKeys; } /* FITS file format utilitIEs */ SBIG_file_ERROR SaveFITS(const char *pFullPath); SBIG_file_ERROR History2FITS(fitsfile *fptr); SBIG_file_ERROR ReadFITSImage(const char *pFullPath);#endif};#endif /* #ifndef _CSBIGimg_ */@H_502_29@解决方法 添加包含文件并链接库后,我收到此错误.这是因为lib是用非unicode构建的,我的应用程序是unicode.匹配他们修复它.@H_502_29@ @H_502_29@ 总结
以上是内存溢出为你收集整理的c – 错误LNK2019:Visual Studio中未解析的外部符号全部内容,希望文章能够帮你解决c – 错误LNK2019:Visual Studio中未解析的外部符号所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)