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. .lib mystery and headache [modified]

.lib mystery and headache [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
regexquestion
6 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.
  • J Offline
    J Offline
    JackPuppy
    wrote on last edited by
    #1

    the command line of linker in project-property contains:kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib however it doesn't contain "boost_regex-vc80-mt-1_37.lib" which I used to use boost_regex-vc80-mt-1_37.dll and the latter one contains regex_search() function and so on. And I find I can use regex_search,smatch in My Application soomthly. All I do in my source code is including Two head files. I am wondering how does the complier locate "boost_regex-vc80-mt-1_37.lib"? I know there is only symbols(variable names,function names, etc)in .lib, even the complier gain the .lib, how the linker gain the corespondent .dll's name. Can somebody tell me? Thanks a lot.

    modified on Friday, March 6, 2009 3:08 PM

    L E 2 Replies Last reply
    0
    • J JackPuppy

      the command line of linker in project-property contains:kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib however it doesn't contain "boost_regex-vc80-mt-1_37.lib" which I used to use boost_regex-vc80-mt-1_37.dll and the latter one contains regex_search() function and so on. And I find I can use regex_search,smatch in My Application soomthly. All I do in my source code is including Two head files. I am wondering how does the complier locate "boost_regex-vc80-mt-1_37.lib"? I know there is only symbols(variable names,function names, etc)in .lib, even the complier gain the .lib, how the linker gain the corespondent .dll's name. Can somebody tell me? Thanks a lot.

      modified on Friday, March 6, 2009 3:08 PM

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      JackPuppy wrote:

      smatch in My Application soomthly

      I have no idea what that means

      JackPuppy wrote:

      how the linker gain the corespondent .dll's name.

      Perhaps they used this[^]?

      1 Reply Last reply
      0
      • J JackPuppy

        the command line of linker in project-property contains:kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib however it doesn't contain "boost_regex-vc80-mt-1_37.lib" which I used to use boost_regex-vc80-mt-1_37.dll and the latter one contains regex_search() function and so on. And I find I can use regex_search,smatch in My Application soomthly. All I do in my source code is including Two head files. I am wondering how does the complier locate "boost_regex-vc80-mt-1_37.lib"? I know there is only symbols(variable names,function names, etc)in .lib, even the complier gain the .lib, how the linker gain the corespondent .dll's name. Can somebody tell me? Thanks a lot.

        modified on Friday, March 6, 2009 3:08 PM

        E Offline
        E Offline
        Eytukan
        wrote on last edited by
        #3

        In the linker option, you need to give the path of your boost lib. Open your project properties dialog,

        Config&properties->Linker->General Options->AddtitionalLibrarayDirectories[//Give the path of your libs here]

        Then in Input option,

        Likner->Input->AdditionalDependencies[// Here specify your boos lib] //Also you can give absolute paths here.

        Alternatively, In your code you can use

        #pragma comment(lib,"Absolute_path_to_your_lib")

        JackPuppy wrote:

        I know there is only symbols(variable names,function names, etc)in .lib, even the complier gain the .lib, how the linker gain the corespondent .dll's name.

        Good question, but unfortunately the lib doesn't tell you about location details of your DLL. The lib just contains the exported symbols of the dll. It just talks about it. So when compiling you don't need the dll. Just a lib reference is enough. But at run time, you need to keep your dll along with your .exe or in system folders.

        He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

        J 1 Reply Last reply
        0
        • E Eytukan

          In the linker option, you need to give the path of your boost lib. Open your project properties dialog,

          Config&properties->Linker->General Options->AddtitionalLibrarayDirectories[//Give the path of your libs here]

          Then in Input option,

          Likner->Input->AdditionalDependencies[// Here specify your boos lib] //Also you can give absolute paths here.

          Alternatively, In your code you can use

          #pragma comment(lib,"Absolute_path_to_your_lib")

          JackPuppy wrote:

          I know there is only symbols(variable names,function names, etc)in .lib, even the complier gain the .lib, how the linker gain the corespondent .dll's name.

          Good question, but unfortunately the lib doesn't tell you about location details of your DLL. The lib just contains the exported symbols of the dll. It just talks about it. So when compiling you don't need the dll. Just a lib reference is enough. But at run time, you need to keep your dll along with your .exe or in system folders.

          He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

          J Offline
          J Offline
          JackPuppy
          wrote on last edited by
          #4

          thanks pal! however I didn't "Likner->Input->AdditionalDependencies[// Here specify your boos lib] //Also you can give absolute paths here", neither "#pragma comment(lib,"Absolute_path_to_your_lib". But I can use regex_search(), and why? it's confusing?(I did include the lib's directory in project property dialog). Further the lib seems to contain at least the name of the dll, however see this lib codes I have dumpbin from a lib:

          Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
          Copyright (C) Microsoft Corporation. All rights reserved.

          Dump of file E:Visual Studio 2005\Projects\DLLexperiment\debug\dllshiyan.lib

          File Type: LIBRARY

          Archive member name at 8: /
          49B21595 time/date Sat Mar 07 14:35:01 2009
          uid
          gid
          0 mode
          7A size
          correct header end

          5 public symbols
          
            17E \_\_IMPORT\_DESCRIPTOR\_dllshiyan
            3B0 \_\_NULL\_IMPORT\_DESCRIPTOR
            4EA dllshiyan\_NULL\_THUNK\_DATA
            642 \_\_imp\_\_add
            642 \_add
          

          Archive member name at BE: /
          49B21595 time/date Sat Mar 07 14:35:01 2009
          uid
          gid
          0 mode
          84 size
          correct header end

          4 offsets
          
              1      17E
              2      3B0
              3      4EA
              4      642
          
          5 public symbols
          
              1 \_\_IMPORT\_DESCRIPTOR\_dllshiyan
              2 \_\_NULL\_IMPORT\_DESCRIPTOR
              4 \_\_imp\_\_add
              4 \_add
              3 dllshiyan\_NULL\_THUNK\_DATA
          

          Archive member name at 17E: dllshiyan.dll/
          49B21595 time/date Sat Mar 07 14:35:01 2009
          uid
          gid
          0 mode
          1F6 size
          correct header end

          FILE HEADER VALUES
          14C machine (x86)
          3 number of sections
          49B21595 time date stamp Sat Mar 07 14:35:01 2009
          110 file pointer to symbol table
          8 number of symbols
          0 size of optional header
          100 characteristics
          32 bit word machine

          SECTION HEADER #1
          .debug$S name
          0 physical address
          0 virtual address
          44 size of raw data
          8C file pointer to raw data (0000008C to 000000CF)
          0 file pointer to relocation table
          0 file pointer to line numbers
          0 number of relocations
          0 number of line numbers
          42100040 flags
          Initialized Data
          Discardable
          1 byte align
          Read Only

          SECTION HEADER #2
          .idata$2 name
          0 physical address
          0 virtual address
          14 size of raw data
          D0 file pointer to raw

          J 1 Reply Last reply
          0
          • J JackPuppy

            thanks pal! however I didn't "Likner->Input->AdditionalDependencies[// Here specify your boos lib] //Also you can give absolute paths here", neither "#pragma comment(lib,"Absolute_path_to_your_lib". But I can use regex_search(), and why? it's confusing?(I did include the lib's directory in project property dialog). Further the lib seems to contain at least the name of the dll, however see this lib codes I have dumpbin from a lib:

            Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
            Copyright (C) Microsoft Corporation. All rights reserved.

            Dump of file E:Visual Studio 2005\Projects\DLLexperiment\debug\dllshiyan.lib

            File Type: LIBRARY

            Archive member name at 8: /
            49B21595 time/date Sat Mar 07 14:35:01 2009
            uid
            gid
            0 mode
            7A size
            correct header end

            5 public symbols
            
              17E \_\_IMPORT\_DESCRIPTOR\_dllshiyan
              3B0 \_\_NULL\_IMPORT\_DESCRIPTOR
              4EA dllshiyan\_NULL\_THUNK\_DATA
              642 \_\_imp\_\_add
              642 \_add
            

            Archive member name at BE: /
            49B21595 time/date Sat Mar 07 14:35:01 2009
            uid
            gid
            0 mode
            84 size
            correct header end

            4 offsets
            
                1      17E
                2      3B0
                3      4EA
                4      642
            
            5 public symbols
            
                1 \_\_IMPORT\_DESCRIPTOR\_dllshiyan
                2 \_\_NULL\_IMPORT\_DESCRIPTOR
                4 \_\_imp\_\_add
                4 \_add
                3 dllshiyan\_NULL\_THUNK\_DATA
            

            Archive member name at 17E: dllshiyan.dll/
            49B21595 time/date Sat Mar 07 14:35:01 2009
            uid
            gid
            0 mode
            1F6 size
            correct header end

            FILE HEADER VALUES
            14C machine (x86)
            3 number of sections
            49B21595 time date stamp Sat Mar 07 14:35:01 2009
            110 file pointer to symbol table
            8 number of symbols
            0 size of optional header
            100 characteristics
            32 bit word machine

            SECTION HEADER #1
            .debug$S name
            0 physical address
            0 virtual address
            44 size of raw data
            8C file pointer to raw data (0000008C to 000000CF)
            0 file pointer to relocation table
            0 file pointer to line numbers
            0 number of relocations
            0 number of line numbers
            42100040 flags
            Initialized Data
            Discardable
            1 byte align
            Read Only

            SECTION HEADER #2
            .idata$2 name
            0 physical address
            0 virtual address
            14 size of raw data
            D0 file pointer to raw

            J Offline
            J Offline
            JackPuppy
            wrote on last edited by
            #5

            there isn't(or I couldn't find it out)plus,this is really very confused reading, can you give me some acrtiles on what each sentence in this lib mean? thanks!

            E 1 Reply Last reply
            0
            • J JackPuppy

              there isn't(or I couldn't find it out)plus,this is really very confused reading, can you give me some acrtiles on what each sentence in this lib mean? thanks!

              E Offline
              E Offline
              Eytukan
              wrote on last edited by
              #6

              This[^] may help you. But I don't understand, why do you need to check them. You may want to DUMPBIN the contents of the DLL rather?

              He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

              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