Upgrade Issue: Compile error C2327 with import dll under VC8/VS2005

Issue:
When I upgrade an exe project from VC7.1 to VC8, it says upgrade
succeed. But When I try to compile the project, it outputs a lot of errors.
 
../debug/msado15.tlh(1024) : error C2327: 'CDO::_ADO::Properties' : is not a type name, static, or enumerator
../debug/msado15.tlh(2086) : error C2327: 'CDO::Command15::Parameters' : is not a type name, static, or enumerator
../debug/msado15.tlh(2285) : error C2327: 'CDO::Connection15::Errors' : is not a type name, static, or enumerator
../debug/msado15.tlh(2525) : error C2327: 'CDO::Recordset15::Fields' : is not a type name, static, or enumerator
../debug/msado15.tlh(3124) : error C2327: 'CDO::_Record::Fields' : is not a type name, static, or enumerator
../debug/msado15.tli(109) : error C2065: '_result' : undeclared identifier
../debug/cdosys.tlh(628) : error C2327: 'CDO::IConfiguration::Fields' : is not a type name, static, or enumerator
../debug/cdosys.tlh(814) : error C2327: 'CDO::IBodyPart::Fields' : is not a type name, static, or enumerator
../debug/cdosys.tlh(1090) : error C2327: 'CDO::IMessage::Fields' : is not a type name, static, or enumerator
../debug/cdosys.tlh(1100) : error C2327: 'CDO::IMessage::Fields' : is not a type name, static, or enumerator
 
In my project, the import sentences are written like follows:
 
#include "stdafx.h"
#include "Resource.h"
#include "ProcessorThread.h"
#include <string>
#import "c:/program files/common files/system/ado/msado15.dll"
rename("ADODB","CDO") rename( "EOF", "adoEOF" )
#import <cdosys.dll>
 
 
Root Reason:
The msado15.tlh and cdosys.tlh are not generated correctly. When I compare the .tlh file generated by 2003 and 2005, I noticed the keyword “struct” is missed in some method definitions in the tlh file generated by 2005.
For example: in msado15.tlh
virtual HRESULT __stdcall get_Item (
        /*[in]*/ VARIANT Index,
        /*[out,retval]*/ struct Property * * ppvObject ) = 0; // this struct is missed in the tlh generated under VS2005
 
virtual HRESULT __stdcall get_Item (
        /*[in]*/ VARIANT Index,
        /*[out,retval]*/ struct Error * * ppvObject ) = 0;  // this struct is missed in the tlh generated under VS2005
 
           
The generation of tlh files is affected by some codes in this project, which is compiled earlier than the import sentences.
 
Solution:
Move the import sentences to the very beginning of stdafx.h. Maybe move to other positions could also make things work. The only thing I did is to make the import sentences compiled earlier than other sentences, by moving their position.

OSGI框架 Felix compile issue

06-15

在Ubuntu机器上使用Maven环境编译Apache Felix出现问题,请大家帮忙看下。看上去像本地JAVA的ClassPath不太对。但是我执行其他Java程序是正常的。rnrn有人下载编译过Felix吗?请提供一下步骤,目前我的步骤如下:rnrnI following http://felix.apache.org/documentation/development/building-felix.html to build felix but failedrnrn1. Maven environmentrnApache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)rnMaven home: /root/UPnP_DM/Java/Maven/apache-maven-3.3.3rnJava version: 1.7.0_79, vendor: Oracle CorporationrnJava home: /usr/lib/jvm/jdk1.7.0_79/jrernDefault locale: en_US, platform encoding: UTF-8rnOS name: "linux", version: "3.2.0-70-generic", arch: "i386", family: "unix"rnrn2.execute ./build_run.sh to buildrnrn3.Failed log as followingrn [exec] [INFO]rn [exec] [INFO] --- animal-sniffer-maven-plugin:1.7:check (default) @ org.apache.felix.bundlerepository ---rn [exec] [INFO] Checking unresolved references to org.codehaus.mojo.signature:java13-sun:1.0rn [exec] [ERROR] Undefined reference: java/lang/RuntimeException.(Ljava/lang/String;Ljava/lang/Throwable;)V in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/InterruptedResolutionException.classrn [exec] [ERROR] Undefined reference: java/lang/RuntimeException.(Ljava/lang/Throwable;)V in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/InterruptedResolutionException.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.()V in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.append(Ljava/lang/String;)Ljava/lang/StringBuilder; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.append(I)Ljava/lang/StringBuilder; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.toString()Ljava/lang/String; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/Exception.(Ljava/lang/String;Ljava/lang/Throwable;)V in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/Long.valueOf(J)Ljava/lang/Long; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/Double.valueOf(D)Ljava/lang/Double; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.append(C)Ljava/lang/StringBuilder; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.setLength(I)V in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.length()I in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/String.split(Ljava/lang/String;)[Ljava/lang/String; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/String.replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/SpecXMLPullParser.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService$ResourceSelectionStrategy.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.()V in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService$ResourceSelectionStrategy.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.append(Ljava/lang/String;)Ljava/lang/StringBuilder; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService$ResourceSelectionStrategy.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.append(Ljava/lang/Object;)Ljava/lang/StringBuilder; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService$ResourceSelectionStrategy.classrn [exec] [ERROR] Undefined reference: java/lang/StringBuilder.toString()Ljava/lang/String; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService$ResourceSelectionStrategy.classrn [exec] [ERROR] Undefined reference: java/util/Collections.emptyMap()Ljava/util/Map; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/RequirementImpl.classrn [exec] [ERROR] Undefined reference: java/util/regex/Pattern.matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/RequirementImpl.classrn [exec] [ERROR] Undefined reference: java/util/regex/Matcher.replaceAll(Ljava/lang/String;)Ljava/lang/String; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/RequirementImpl.classrn [exec] [ERROR] Undefined reference: java/lang/IllegalArgumentException.initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; in /root/UPnP_DM/Java/Felix_Src/felix/bundlerepository/target/classes/org/apache/felix/bundlerepository/impl/RequirementImpl.classrnrn [exec] [INFO] ------------------------------------------------------------------------rn [exec] [INFO] Reactor Summary:rn [exec] [INFO]rn [exec] [INFO] Apache Felix Utils ................................. SUCCESS [ 5.462 s]rn [exec] [INFO] Apache Felix Bundle Repository ..................... FAILURE [ 4.921 s]rn [exec] [INFO] Apache Felix Bundle Repository - OSGi CT integration SKIPPEDrn [exec] [INFO] Apache Felix ....................................... SKIPPEDrn [exec] [INFO] ------------------------------------------------------------------------rn [exec] [INFO] BUILD FAILURErn [exec] [INFO] ------------------------------------------------------------------------rn [exec] [INFO] Total time: 11.666 srn [exec] [INFO] Finished at: 2015-06-15T14:36:15+08:00rn [exec] [INFO] Final Memory: 41M/495Mrn [exec] [INFO] ------------------------------------------------------------------------rn [exec] [ERROR] Failed to execute goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.7:check (default) on project org.apache.felix.bundlerepository: Signature errors found. Verify them and put @IgnoreJRERequirement on them. -> [Help 1]rn [exec] [ERROR]rn [exec] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.rn [exec] [ERROR] Re-run Maven using the -X switch to enable full debug logging.rn [exec] [ERROR]rn [exec] [ERROR] For more information about the errors and possible solutions, please read the following articles:rn [exec] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExceptionrn [exec] [ERROR]rn [exec] [ERROR] After correcting the problems, you can resume the build with the commandrn [exec] [ERROR] mvn -rf :org.apache.felix.bundlerepositoryrnrnBUILD FAILEDrn/root/UPnP_DM/Java/Felix_Src/felix/build.xml:74: exec returned: 1rnrnTotal time: 14 secondsrnUnable to access jarfile bin/felix.jar 论坛

没有更多推荐了,返回首页