Return-Path: Delivered-To: apmail-lucene-pylucene-dev-archive@minotaur.apache.org Received: (qmail 11617 invoked from network); 21 Oct 2010 18:19:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Oct 2010 18:19:40 -0000 Received: (qmail 29481 invoked by uid 500); 21 Oct 2010 18:19:39 -0000 Delivered-To: apmail-lucene-pylucene-dev-archive@lucene.apache.org Received: (qmail 29460 invoked by uid 500); 21 Oct 2010 18:19:39 -0000 Mailing-List: contact pylucene-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pylucene-dev@lucene.apache.org Delivered-To: mailing list pylucene-dev@lucene.apache.org Received: (qmail 29452 invoked by uid 99); 21 Oct 2010 18:19:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 18:19:39 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [66.159.224.220] (HELO ovaltofu.org) (66.159.224.220) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 18:19:33 +0000 Received: from [192.168.149.101] ([72.14.229.87]) (authenticated bits=0) by ovaltofu.org (8.14.4/8.14.4) with ESMTP id o9LIJ7f8028068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 21 Oct 2010 11:19:10 -0700 (PDT) Date: Thu, 21 Oct 2010 11:20:12 -0700 (PDT) From: Andi Vajda X-X-Sender: vajda@yuzu.local Reply-To: Andi Vajda To: pylucene-dev@lucene.apache.org Subject: Re: Unresolved external symbol errors when linking example native c++ code that uses jcc In-Reply-To: Message-ID: References: User-Agent: Alpine 2.01 (OSX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2080522766-1287685215=:91716" --0-2080522766-1287685215=:91716 Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 21 Oct 2010, Imre Andr�s wrote: > JCCEnv.h has the following: > > ... > #ifdef _jcc_shared > _DLL_IMPORT extern JCCEnv *env; > _DLL_IMPORT extern DWORD VM_ENV; > #else > _DLL_EXPORT extern JCCEnv *env; > _DLL_EXPORT extern DWORD VM_ENV; > #endif > ... > > I suspect here is the root of my linker problem. Where should this *env > get resolved? These are in JCCEnv.cpp and jcc.cpp which gets linked with your shared library either dynamically (when using --shared) or statically. You need to link a piece of jcc itself with your code. To get an example link line, ask jcc to create a python extension for you, a correct link line flies by. Andi.. > > > Thanks, > Andr�s > > > "Imre Andr�s" �rta: >> Hi list,> >> > I intend to use jcc to ease calling Java code from native code. I managed to build and install it. Now I try to build my first test code from within MS VS 2010 Win32 console app project. Despite setting up the libs and includes I still get linker errors:> >> > ------------------------------------------------------------------> > Link:> > C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\out\app\PeldaProgram\ZipBe\bin\test\src\Debug\jcc.exe" /INCREMENTAL /NOLOGO python27.lib _jcc.lib jvm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Debug\jcc.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\out\app\PeldaProgram\ZipBe\bin\test\src\Debug\jcc.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\out\app\PeldaProgram\ZipBe\bin\test\src\Debug\jcc.lib" /MACHINE:X86 Debug\jcc.exe.embed.manifest.res> > Debug\jcc.obj> > Debug\stdafx.obj> > Debug\__wrap__.obj> > Creating library C:\out\app\PeldaProgram\ZipBe\bin\test\src\Debug\jcc.lib and object C:\out\app\PeldaProgram\ZipBe\bin\test\src\Debug\jcc.exp> > 1>jcc.obj : error LNK2001: unresolved external symbol "unsigned long VM_ENV" (?VM_ENV@@3KA)> > 1>stdafx.obj : error LNK2001: unresolved external symbol "unsigned long VM_ENV" (?VM_ENV@@3KA)> > 1>__wrap__.obj : error LNK2001: unresolved external symbol "unsigned long VM_ENV" (?VM_ENV@@3KA)> > 1>jcc.obj : error LNK2001: unresolved external symbol "class JCCEnv * env" (?env@@3PAVJCCEnv@@A)> > 1>stdafx.obj : error LNK2001: unresolved external symbol "class JCCEnv * env" (?env@@3PAVJCCEnv@@A)> > 1>__wrap__.obj : error LNK2001: unresolved external symbol "class JCCEnv * env" (?env@@3PAVJCCEnv@@A)> > 1>C:\out\app\PeldaProgram\ZipBe\bin\test\src\Debug\jcc.exe : fatal error LNK1120: 2 unresolved externals> > 1>Done Building Project "C:\out\app\PeldaProgram\ZipBe\bin\test\jcc\jcc.vcxproj" (rebuild target(s)) -- FAILED.> >> > Build FAILED.> >> > Time Elapsed 00:00:12.60> > ------------------------------------------------------------------> >> >> > jni.h and Native2Java.h (jcc generated from the java class I intend to use in native c++ code) is added to stdafx.h. Now I have no idea where the above symbols come from, and how should I resolve them.> >> >> > Regards,> > Andr�s> >> > > --0-2080522766-1287685215=:91716--