LNK2001: unresolved external symbol [message #94009] |
Fri, 22 August 2003 08:20 |
Erik
Messages: 17 Registered: September 2002
|
Junior Member |
|
|
Hi !
I am trying to compile a C++ program that uses OCI but get the
following linker errors. I'm running Oracle 9i on Windows 2000,
compiling with Microsoft
Visual C++ 6.0.
Does anyone know a solution or what I am doing wrong?
Any help would be greatly appreciated. Thanks,
Linking...
server.obj : error LNK2001: unresolved external symbol
_OCIDescriptorFree
server.obj : error LNK2001: unresolved external symbol _OCIHandleFree
server.obj : error LNK2001: unresolved external symbol _OCIInitialize
server.obj : error LNK2001: unresolved external symbol _OCIAttrSet
server.obj : error LNK2001: unresolved external symbol
_OCIServerAttach
server.obj : error LNK2001: unresolved external symbol _OCIHandleAlloc
server.obj : error LNK2001: unresolved external symbol _OCIEnvInit
server.obj : error LNK2001: unresolved external symbol
_OCISessionBegin
server.obj : error LNK2001: unresolved external symbol _OCIErrorGet
server.obj : error LNK2001: unresolved external symbol _OCIStmtPrepare
server.obj : error LNK2001: unresolved external symbol _OCIStmtExecute
server.obj : error LNK2001: unresolved external symbol _OCIAttrGet
server.obj : error LNK2001: unresolved external symbol _OCIBindByName
server.obj : error LNK2001: unresolved external symbol _OCIDefineByPos
server.obj : error LNK2001: unresolved external symbol
_OCIServerDetach
server.obj : error LNK2001: unresolved external symbol _OCISessionEnd
Debug/server.exe : fatal error LNK1120: 16 unresolved externals
Error executing link.exe.
server.exe - 17 error(s), 0 warning(s)
----------------------------------------------------------------
|
|
|
|
Re: LNK2001: unresolved external symbol [message #94060 is a reply to message #94009] |
Fri, 05 December 2003 03:34 |
Alfageme
Messages: 3 Registered: December 2003
|
Junior Member |
|
|
Hello Eric!
I have seen your question and i think that i have the same problem. I am trying to compile a C program that uses oci but get the following linker error. I'm running Oracle 9i on Windows 2000, compiling with Microsoft Visual C++ .net.
error LNK2001: unresolved external symbol "int __cdecl orlon(struct cda_def *,unsigned char *,unsigned char *,int,unsigned char *,int,int)" (?orlon@@$$FYAHPAUcda_def@@PAE1H1HH@Z).
1_ I do this: Tools->Options->Projects->VC++ Directories, in the drop down menu titled Show directories for:, select Include files, and then type in the directory for the include file: d:oracleora90ociinclude.
2_ In my program i write:
#include ocidfn.h
#include ocidem.h
#include ociapr.h
#include oratypes.h
3_ And to link i do this: on the main toolbar select Project->Properties->Linker->Input and the "Additional Dependencies" line, add the library (only one): oci.lib.
But after these steps, i get allways the same error.
Can you tell if i don´t use correctly the visual studio .net or if i am not including the right library.
Regards and throw a hand, please.
|
|
|
|
|
Re: LNK2001: unresolved external symbol [message #94293 is a reply to message #94291] |
Thu, 01 July 2004 17:39 |
Jai Vrat
Messages: 20 Registered: June 2004
|
Junior Member |
|
|
That is sure that you are missing some libraries. if this symbol/function is provided by Oracle/Pro*C precomp then you can find it in your $ORACLE_HOME. Please search for this symbol in all .a and .so files in this directory.
Or you can search from the same in your projects .a and .so files. Please correct the LD_LIBRARY_PATH environment variable accordingly.
You can refer to sample makefile $ORACLE_HOME/precomp/demo/proc/demo_proc.mk and the env_precomp.mk . These have all the standarad places refereed by precomp.
alternatively.. save this is find.ksh
then use this to find it the missing file to be included.
can chage it for .so --( this is to search symbol in .a files only)
suppose you get error as
undefined symbol sqlcxt
Use it as
./find.ksh sqlcxt
#!/bin/ksh
for file in `find /usr -name "*.a" -print 2>/dev/null`
do
nm $file |grep -i fclode 2>/dev/null 1>&2
if [[ $? -eq 0 ]]
then
echo The file is $file
fi
done
|
|
|
Re: LNK2001: unresolved external symbol [message #94331 is a reply to message #94060] |
Fri, 06 August 2004 08:01 |
cybersax
Messages: 1 Registered: August 2004
|
Junior Member |
|
|
I've got the same problem, and I have find a solution, it isn't the best, but it's work,
you can add the option /FORCE into Project->Properties->Linker.
It doesn't work the first time, only the second time.
I know that it isn't correct but it's can help somebody.
|
|
|
|
Re: LNK2001: unresolved external symbol [message #94406 is a reply to message #94291] |
Thu, 14 October 2004 06:08 |
Hugo Roberto COLOMBO
Messages: 2 Registered: October 2004
|
Junior Member |
|
|
Dear Dheeraj
Really I´m facing this problem again due to a different situation, but one option which could work is to change the LINK.EXE program.
If You got añother solution I´ll be very gratefull with You if You send it to me.
Thank You.
GOOD LUCK!
Hugo COLOMBO
|
|
|
|
|
Re: LNK2001: unresolved external symbol [message #94534 is a reply to message #94009] |
Wed, 12 January 2005 12:28 |
Clarence
Messages: 1 Registered: January 2005
|
Junior Member |
|
|
I had the same problem in VS NET and resolved it by doing the following:
1) Projects -> Properties
2) Under Configuration Properties:
2a) Click on Linker -> Input, and add 'oci.lib' in Additional Dependencies
3a) Click on C/C++ -> General, and add 'c:oracleora92ocilibmsvc' in Additional Include Directories
Once these are added, the linking completes without an error.
|
|
|
Re: LNK2001: unresolved external symbol [message #109432 is a reply to message #94291] |
Thu, 24 February 2005 08:34 |
Srivalli
Messages: 2 Registered: March 2002
|
Junior Member |
|
|
Hello,
Can u help me in solving this problem? please !!!!!!!!
To get the handle of JFrame, i used FindWindow. I used as given below in JNI.
JNIEXPORT void JNICALL
Java_T_Tmanager_init1(JNIEnv *env, jclass cla,jstring str)
{
const char* cw = env->GetStringUTFChars(str, 0);
HWND hwnd = FindWindow(NULL,cw);
env->ReleaseStringUTFChars(str, cw);
InitTwain(hwnd);
}
When i tried to create dll file, it is showing the following error :
TmanagerImpl1.obj : error LNK2001 : unresolved external symbol _imp_FindWindowA@8
sample.dll: fatal error LNK1120 : 1 unresolved externals
How to solve this problem? Help me in solving this.
Thanks,
Sri
|
|
|