Solved

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

Posted on 2006-07-19
8
2,038 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
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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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 500 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

770 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