Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Examples only build with cl dos compiler?

Status
Not open for further replies.

TheMillionDollarMan

Programmer
Jun 10, 2002
132
US

When I try to compile some of the Oracle examples for OCI they don't compile with in VC6.0 but when I use the dos utility CL it compiles.

I have made sure that the directories for the includes and libraries have been set correctly.

What could be the problem.

Thanks
 
If it will compile using the MS Compiler on the command line you should be able to get it to compile from the IDE. Are you compiling directly from the command line or using a batch file? If you are compiling from a batch file then look at the link command and make sure you have also included the correct libraries in the project->settings->link options tab.

HTH,
JC
 
From a batch file.

I am trying to translate this from the batch file
cl
-IC:\Ora817\\oci\include
-I.
-D_DLL
-D_MT
%1.cpp
/link
/LIBPATH:C:\Ora817\\oci\lib\msvc
oci.lib
msvcrt.lib
/nod:libc



Into the list of options in the IDE.

Can you help.

Thanks

 
As far as I know, cl is not a DOS utillity, but the compiler that's 'hidden' below the IDE-interface.

If you can't make it work from the IDE, it's probably one or more project setting(s) that are not correct.

Try and execute this on a command prompt :
cl -?

You will see several pages with possible options. I am pretty sure you will recognize some of them.
The very short explanation shown next to each option might give you an idea about the meaning (Also see the documentation on the compiler).

/JOlesen
 
Ok - there shouldn't be any problem building the project from the IDE. First, go to Project->Settings and click on the Link tab. In the Object/Library modules text field add to the end of the list: oci.lib msvcrt.lib (separated by a space only), then go to Tools->Options and select the Directories tab, for the Include Files window insert or browse to the Ora817\oci\include directory. Then select Library Files from the dropdown list in the Show directories for: Then add C:\Ora817\oci\lib\msv to the directories' list. After that it should compile. However, looking at your batch file I think you will get a warning about LIBC.lib if that is the case you can ignore the MS Compiler LIBC.lib by returning to the Project->Settings dialog, select Input from the Category dropdown and in the Ignore Libraries text field type LIBC.lib.

HTH,
JC
 

Thanks I have that setup ok but I am still getting this error.


fatal error C1010: unexpected end of file while looking for precompiled header directive


Thanks a lot so far though...
 
Not sure now but have a feeling that the -D, which is a precompiler directive, is the culprit. So you might want to try going to Project->Settings click on the C++ tab and in the Undefined symbols text field type _DLL _MT

HTH,
JC
 
Thanks Mongooses!!

Project->Settings->C/C++
Then I choose Precompiled Headers->Not using precompiled headers.

Now it compiles in VC++ IDE.

Thanks



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top