Solved

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

Posted on 2006-07-19
8
2,007 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures 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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now