Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What's the problem of my program?

What's the problem of my program?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++debuggingquestionworkspace
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Ming Luo
    wrote on last edited by
    #1

    Hi all: The following is my program. #define WIN32_LEAN_AND_MEAN #include #include #include #include #include "lapack\matrix_clapack.h" #define NDIM 2 #define M_PI 3.14 int main (){ integer i, j, info2; integer N, NRHS, LDA, LDB; doublecomplex *A; doublecomplex *B; static integer IPIV[NDIM], INFO; A = (doublecomplex*) malloc(NDIM*NDIM*sizeof(doublecomplex)); B = (doublecomplex*) malloc(NDIM*sizeof(doublecomplex)); N=NDIM; NRHS=1; LDA=NDIM; LDB=NDIM; for (i=0;i And here is the compiler message: `1>------ Build started: Project: test, Configuration: Debug Win32 ------ 1>Compiling... 1>test.cpp 1>Linking... 1>test.obj : error LNK2019: unresolved external symbol _zgesv_ referenced in function _main 1>D:\Project\test\Debug\test.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://d:\Project\test\test\Debug\BuildLog.htm" 1>test - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========` I just want to try to test the LAPACK library. But what's the problem with this program please? Thanks Asura

    R 1 Reply Last reply
    0
    • M Ming Luo

      Hi all: The following is my program. #define WIN32_LEAN_AND_MEAN #include #include #include #include #include "lapack\matrix_clapack.h" #define NDIM 2 #define M_PI 3.14 int main (){ integer i, j, info2; integer N, NRHS, LDA, LDB; doublecomplex *A; doublecomplex *B; static integer IPIV[NDIM], INFO; A = (doublecomplex*) malloc(NDIM*NDIM*sizeof(doublecomplex)); B = (doublecomplex*) malloc(NDIM*sizeof(doublecomplex)); N=NDIM; NRHS=1; LDA=NDIM; LDB=NDIM; for (i=0;i And here is the compiler message: `1>------ Build started: Project: test, Configuration: Debug Win32 ------ 1>Compiling... 1>test.cpp 1>Linking... 1>test.obj : error LNK2019: unresolved external symbol _zgesv_ referenced in function _main 1>D:\Project\test\Debug\test.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://d:\Project\test\test\Debug\BuildLog.htm" 1>test - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========` I just want to try to test the LAPACK library. But what's the problem with this program please? Thanks Asura

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      The implementation of the zgesv_ function that is inside the LAPACK library could not be found during the linking process. You have to add the LAPACK library, the .lib file, to the list of libraries you're building with. Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".


      "It's supposed to be hard, otherwise anybody could do it!" - selfquote

      "No one remembers a coward!" - Jan Elfström 1998
      "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

      P 1 Reply Last reply
      0
      • R Roger Stoltz

        The implementation of the zgesv_ function that is inside the LAPACK library could not be found during the linking process. You have to add the LAPACK library, the .lib file, to the list of libraries you're building with. Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".


        "It's supposed to be hard, otherwise anybody could do it!" - selfquote

        "No one remembers a coward!" - Jan Elfström 1998
        "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

        P Offline
        P Offline
        PJ Arends
        wrote on last edited by
        #3

        Roger Stoltz wrote:

        Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".

        An easier way is to use a #pragma comment(lib "LAPACK.lib") (assuming LAPACK.lib is the lib file name) directive to link import libraries.


        You may be right
        I may be crazy
        -- Billy Joel --

        Within you lies the power for good, use it!!!

        R 1 Reply Last reply
        0
        • P PJ Arends

          Roger Stoltz wrote:

          Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".

          An easier way is to use a #pragma comment(lib "LAPACK.lib") (assuming LAPACK.lib is the lib file name) directive to link import libraries.


          You may be right
          I may be crazy
          -- Billy Joel --

          Within you lies the power for good, use it!!!

          R Offline
          R Offline
          Roger Stoltz
          wrote on last edited by
          #4

          Ha, that one I didn't know about! :rose: Thanks for the info, PJ. Nice to know. My 5 for that! This day was not in vain after all, now that I've learnt something new...:-D


          "It's supposed to be hard, otherwise anybody could do it!" - selfquote

          "No one remembers a coward!" - Jan Elfström 1998
          "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups