CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2011
    Posts
    13

    Question CFITSIO unresolved external symbol error

    I am compiling my source code which is calling "fitsio.h" file from fits library , and then in fitsio.h another header file is getting called named longname.h , this ffclos , ffgpxv all are defined in "longnam.h" .While I am compiling its giving error message :

    usimage.cpp
    Generating Code...
    Linking...
    Creating library .\Output/gci2.lib and object .\Output/gci2.exp
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffclos
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffgpxv
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffthdu
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffgisz
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffgidm
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffghdt
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffghdt
    .\Release/gci2.dll : fatal error LNK1120: 8 unresolved externals
    Error executing link.exe.
    PixCel.exe - 8 error(s), 3 warning(s)

  2. #2
    Join Date
    Mar 2011
    Posts
    13

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by karimkhan View Post
    I am compiling my source code which is calling "fitsio.h" file from fits library , and then in fitsio.h another header file is getting called named longname.h , this ffclos , ffgpxv all are defined in "longnam.h" .While I am compiling its giving error message :

    usimage.cpp
    Generating Code...
    Linking...
    Creating library .\Output/gci2.lib and object .\Output/gci2.exp
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffclos
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffgpxv
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffthdu
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffgisz
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffgidm
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffghdt
    cam_simulator.obj : error LNK2001: unresolved external symbol _ffghdt
    .\Release/gci2.dll : fatal error LNK1120: 8 unresolved externals
    Error executing link.exe.
    PixCel.exe - 8 error(s), 3 warning(s)
    I already done with linking the cfitsio library by project setting/link/path of .lib file

    and I also added environment variable

    In runtime library multithreaded dll is also set , and also added additional library path ,

    I am using vc ++ 6.0 and win XP....

  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by karimkhan View Post
    I already done with linking the cfitsio library by project setting/link/path of .lib file
    That is not enough. You have to actually give the name of the library you're linking in the project settings. Just giving the path of where the library exists is not enough.

    Regards,

    Paul McKenzie

  4. #4
    Join Date
    Mar 2011
    Posts
    13

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by Paul McKenzie View Post
    That is not enough. You have to actually give the name of the library you're linking in the project settings. Just giving the path of where the library exists is not enough.

    Regards,

    Paul McKenzie
    I already tried out with mentioning the library file name there in project setting ...is it necessary to keep library location at particular location?

    After compiling and checking all the files when it start linking and reach at the function

    "if ( !fits_open_diskfile(&fptr, "Winter.fit", READONLY, &status) ) {
    #endif
    if (fits_get_hdu_type(fptr, &hdutype, &status) || hdutype != IMAGE_HDU) {
    // (void) wxMessageBox(wxT("FITS file is not of an image"),wxT("Error"),wxOK | wxICON_ERROR);
    return true;
    }

    // Get HDUs and size
    fits_get_img_dim(fptr, &naxis, &status);................

    |"

    It gives error message....

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: CFITSIO unresolved external symbol error

    Go to Project Settings -> tab Link -> add the .lib name to the list of "Object/library modules";
    then open the Category "Input" and add the path of that .lib to the list of "Additional library path" list
    Victor Nijegorodov

  6. #6
    Join Date
    Mar 2011
    Posts
    13

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by VictorN View Post
    Go to Project Settings -> tab Link -> add the .lib name to the list of "Object/library modules";
    then open the Category "Input" and add the path of that .lib to the list of "Additional library path" list
    thanks for your reply Sir ,
    But I already have given the path "C:\3270\cfitsio.lib' for additional library...this doesn's solve the problem.

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: CFITSIO unresolved external symbol error

    You either pass in the path C:\3270 to the path list + library name cfitsio.lib - to the list of modules
    or you just pass in the full library name C:\3270\cfitsio.lib to the list of modules.
    Victor Nijegorodov

  8. #8
    Join Date
    Mar 2011
    Posts
    13

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by VictorN View Post
    You either pass in the path C:\3270 to the path list + library name cfitsio.lib - to the list of modules
    or you just pass in the full library name C:\3270\cfitsio.lib to the list of modules.

    Oh thank you Sir , I think it is progressing now

    I added full library name x:\3270.lib to the "object/library module" in project setting

    Now its not giving me error , but before I added this library once I compiled all source file in Build menu it was showing BUILD PIXCEL.EXE AND EXECUTE IXCEL.EXE , as my software is pixcel and after compiling it was allowing me to execute the .exe file

    Now its giving me option "Build cfitsio.lib" and execute now showing pixcel.exe....

    Now its doest show me option for pixcel.exe but

  9. #9
    Join Date
    Mar 2011
    Posts
    13

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by karimkhan View Post
    Oh thank you Sir , I think it is progressing now

    I added full library name c:\3270\cfitsio.lib to the "object/library module" in project setting

    Now its not giving me error , but before I added this library once I compiled all source file in Build menu it was showing BUILD PIXCEL.EXE AND EXECUTE IXCEL.EXE , as my software is pixcel and after compiling it was allowing me to execute the .exe file

    Now its giving me option "Build cfitsio.lib" and execute now showing pixcel.exe....

    Now its doest show me option for pixcel.exe but

    In short when I add C:\3270\cfitsio.lib to the object/library modules it compiles successfully only fitsio.lib and not my original pixcel.exe

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by karimkhan View Post
    In short when I add C:\3270\cfitsio.lib to the object/library modules it compiles successfully only fitsio.lib and not my original pixcel.exe


    Adding or not the "cfitsio.lib to the object/library modules" has nothing to do with compiling. Only including or not the "fitsio.h" matters!

    What did you mean by "it compiles successfully only fitsio.lib and not my original pixcel.exe"?
    Victor Nijegorodov

  11. #11
    Join Date
    Mar 2011
    Posts
    13

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by VictorN View Post


    Adding or not the "cfitsio.lib to the object/library modules" has nothing to do with compiling. Only including or not the "fitsio.h" matters!

    What did you mean by "it compiles successfully only fitsio.lib and not my original pixcel.exe"?
    I mean now after adding this cfitsio.lib file when I compile source file at last it gives
    "
    Linking...

    cfitsio.lib - 0 error(s), 4 warning(s)


    While before I added fitsio it was giving me


    PixCel.exe - 0 error(s), 0 warning(s)

    and my software for which i am coding this that pixcel.exe was starting

    So now it does not create pixcel.exe file ,

    I really bored with this , please give me some sollution...
    before I

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: CFITSIO unresolved external symbol error

    Quote Originally Posted by karimkhan View Post
    I mean now after adding this cfitsio.lib file when I compile source file at last it gives
    "
    Linking...

    cfitsio.lib - 0 error(s), 4 warning(s)
    What type of project are you working with? Is it a some static library?
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured