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