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. How to include a dll and a lib files into a VS project

How to include a dll and a lib files into a VS project

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiocsharporaclehelptutorial
5 Posts 2 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.
  • S Offline
    S Offline
    Schehaider_Aymen
    wrote on last edited by
    #1

    Hello everybody. I'm trying to use OCILIB driver for oracle under Mvisual studio 6 and i need some help to accomplish some duties. in my work i need to include a lib file a dll file and a header file; like . oclib.h . ociliba.dll . ociliba.lib to include the header file, i put the file under "C:\Program Files\Microsoft Visual Studio\VC98\Include" the question is: how could i use the dll and the lib files in my project (i'm using visual studio 6):~ it's a kind of an easy task but i never tried to include dll or lib files into my projects. Thank you very much :|

    "The Ultimate Limit Is Only Your Imagination."

    G 1 Reply Last reply
    0
    • S Schehaider_Aymen

      Hello everybody. I'm trying to use OCILIB driver for oracle under Mvisual studio 6 and i need some help to accomplish some duties. in my work i need to include a lib file a dll file and a header file; like . oclib.h . ociliba.dll . ociliba.lib to include the header file, i put the file under "C:\Program Files\Microsoft Visual Studio\VC98\Include" the question is: how could i use the dll and the lib files in my project (i'm using visual studio 6):~ it's a kind of an easy task but i never tried to include dll or lib files into my projects. Thank you very much :|

      "The Ultimate Limit Is Only Your Imagination."

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      One way is like this - its suitable for small projects I guess :- a) go to Project Settings (ALT F7) b) Select The Link Tab c) Set Category to Input d) In the Object/library modules box, put oci.lib and a space after it - put it at the front for now unless there is a 'collision' in the build/link stage e) In the Additional Library Path box, enter in the path to the .lib module Obviously you include the ocilib.h file with a #include "ocilib.h" ... not sure If I agree with where you put it .. I usually put 3rd party modules in a '3rdParty' Folder

      Projects
      \3rdParty
      \bin <- Libs, dlls
      \inc <- Headers

      In your case they are probably under the Ora92 (or whatever version) directory - they could be left there To Pick up the headers from the structure above or where you have them, you could :- a) go to (again,under project setting) C++ Tab, b) Select Category 'Preprocessor' c) Put the directory ie drive:\Projects\3rdParty\inc in the additional include directories You can also change (independantly) the settings or ALL projects, by going Tools -> Options -> Directories, and using the 'Show Directories For' dropdown and adding the directories for include files, library files etc - some people prefer this approach. For larger projects, I tend to use a modified version of the 1st approach, but I allow for different versions of components by using environment settings (that means I dont need to change the basic build within a project), but see if you can get going in 'simple mode' first hope this helps 'g'

      S 1 Reply Last reply
      0
      • G Garth J Lancaster

        One way is like this - its suitable for small projects I guess :- a) go to Project Settings (ALT F7) b) Select The Link Tab c) Set Category to Input d) In the Object/library modules box, put oci.lib and a space after it - put it at the front for now unless there is a 'collision' in the build/link stage e) In the Additional Library Path box, enter in the path to the .lib module Obviously you include the ocilib.h file with a #include "ocilib.h" ... not sure If I agree with where you put it .. I usually put 3rd party modules in a '3rdParty' Folder

        Projects
        \3rdParty
        \bin <- Libs, dlls
        \inc <- Headers

        In your case they are probably under the Ora92 (or whatever version) directory - they could be left there To Pick up the headers from the structure above or where you have them, you could :- a) go to (again,under project setting) C++ Tab, b) Select Category 'Preprocessor' c) Put the directory ie drive:\Projects\3rdParty\inc in the additional include directories You can also change (independantly) the settings or ALL projects, by going Tools -> Options -> Directories, and using the 'Show Directories For' dropdown and adding the directories for include files, library files etc - some people prefer this approach. For larger projects, I tend to use a modified version of the 1st approach, but I allow for different versions of components by using environment settings (that means I dont need to change the basic build within a project), but see if you can get going in 'simple mode' first hope this helps 'g'

        S Offline
        S Offline
        Schehaider_Aymen
        wrote on last edited by
        #3

        Thx for the answer. it works now. thx you verry much for this help.:thumbsup:

        "The Ultimate Limit Is Only Your Imagination."

        modified on Sunday, May 23, 2010 6:54 PM

        G 1 Reply Last reply
        0
        • S Schehaider_Aymen

          Thx for the answer. it works now. thx you verry much for this help.:thumbsup:

          "The Ultimate Limit Is Only Your Imagination."

          modified on Sunday, May 23, 2010 6:54 PM

          G Offline
          G Offline
          Garth J Lancaster
          wrote on last edited by
          #4

          not sure where thats coming from, and Im sure you'll appreciate, trying to debug something like this remotely is hard - have you started a new project from scratch or are you extending something else you've found ? - have you just installed MSVC and proved it can compile a simple 'hello world' ? What kind of project are you attempting to create - console, gui/MFC, Dialog box - not that it should make too much of a difference If you're a rank beginner, I do feel your pain, and yes, it is hard to find your way around .. I often find the safest way to start with a new API for example is to build myself a little console test harness - start with a console 'hello world' program, build that, then start adding eg the oci stuff to it it.. when thats done and working, then think about applying that knowledge to something bigger/the main project .. that way if something goes wrong, you always have your test harness to refer to - its not quite 'unit testing' but a good start Its been a long time since Ive worked with oci (and never 'directly') - tell me about what you're trying to do and I might be able to suggest an approach 'g'

          S 1 Reply Last reply
          0
          • G Garth J Lancaster

            not sure where thats coming from, and Im sure you'll appreciate, trying to debug something like this remotely is hard - have you started a new project from scratch or are you extending something else you've found ? - have you just installed MSVC and proved it can compile a simple 'hello world' ? What kind of project are you attempting to create - console, gui/MFC, Dialog box - not that it should make too much of a difference If you're a rank beginner, I do feel your pain, and yes, it is hard to find your way around .. I often find the safest way to start with a new API for example is to build myself a little console test harness - start with a console 'hello world' program, build that, then start adding eg the oci stuff to it it.. when thats done and working, then think about applying that knowledge to something bigger/the main project .. that way if something goes wrong, you always have your test harness to refer to - its not quite 'unit testing' but a good start Its been a long time since Ive worked with oci (and never 'directly') - tell me about what you're trying to do and I might be able to suggest an approach 'g'

            S Offline
            S Offline
            Schehaider_Aymen
            wrote on last edited by
            #5

            for that error it was the " that i added to the path when including the lib. now it's gone when i erase it ;) For the oci, i m trying to put on screen the data from an Oracle DB using C++ and this to integrate it into a larger team work. so my part is to begin with the ocilib driver.

            "The Ultimate Limit Is Only Your Imagination."

            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