?
Solved

Compiling and linking a Pro*C application with MS Visual C++ and getting sqlcxt errors.

Posted on 2006-07-19
8
Medium Priority
?
2,123 Views
Last Modified: 2008-01-09
Hello,

I've just ported a C program from VMS to Windows 2000 and have successfully compiled it with the Pro*C compiler that comes with Oracle 9.2.0.x.  My program is when I compile and link using Visual C++....  I'm receiving a couple of external reference errors regarding the second function and sqlcxt while linking.

Any ideas?  Do you use a make file in Windows or is that exclusive to unix?

Thank-you kindly
0
Comment
Question by:DwayneZandbergen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 16

Expert Comment

by:PaulCaswell
ID: 17141989
Hi DwayneZandbergen,

Could you post the errors?

Paul
0
 
LVL 24

Expert Comment

by:slyong
ID: 17143335
You have to add the Pro*C/C++ Library.  The guide here might help: http://www.stanford.edu/dept/itss/docs/oracle/10g/win.101/a96111/integrat.htm
0
 
LVL 3

Expert Comment

by:srinims
ID: 17143748
you have to include the libraries for the pro*C codes in visual c++ settings

I don't remember the exact names of the libraries, but it named like
orasql???.lib, sql90.lib...


and just exclude the libraries you are already using, if it's ported from the old ora proc codes


srini ms
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:DwayneZandbergen
ID: 17145466
Please see my errors below - I will try the above suggestion as well.

Thanks,

Dwayne

------ Build started: Project: PSR, Configuration: Debug Win32 ------
Linking...
psr.obj : error LNK2019: unresolved external symbol _sqlcxt referenced in function _pkg_combo
psr.obj : error LNK2019: unresolved external symbol _sleep referenced in function _main
C:\Apps\PSR\PSR\Debug\PSR.exe : fatal error LNK1120: 2 unresolved externals
Build log was saved at "file://c:\Apps\PSR\PSR\PSR\Debug\BuildLog.htm"
PSR - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
0
 
LVL 3

Accepted Solution

by:
srinims earned 2000 total points
ID: 17146118
you need to include orasql.lib.

and you have to give the path for the orasql.lib in the tools/options/include directories

or you can directly give the fullpath in the input in the link tab of project settings

for the sleep function you have to include the file unistd.h


0
 
LVL 3

Expert Comment

by:srinims
ID: 17146141
or better to use Sleep with caps S. and you can give in milliseconds there instead of the seconds inside sleep with small s
0
 
LVL 3

Expert Comment

by:srinims
ID: 17146179
i think you have to use _sleep inside main instead of simply sleep. or use Sleep with milliseconds
0
 
LVL 1

Author Comment

by:DwayneZandbergen
ID: 17146939
Thanks for your help - I needed to include orasql9.lib and modified the code to reference function _sleep.

Thanks again,

Dwayne
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question