?
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,204 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Suggested Courses

749 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