ObjectiveC++: expected unqualified-id before '@' token
Philip Mötteli
philip.moetteli at econophone.ch
Sun Jun 11 15:16:30 CDT 2006
Hi
I try to use the VSDK C++ from a program, written in Objective-C.
I have a very simple header file like this:
#import <PMPersistence/PMPDBMS.h>
#import <Carbon/Carbon.h>
#import <VShared/VSQL/Interfaces/VSQL_I_Server.h>
@interface PMVServerProcess : PMPDBMS
{
VSQL::I_Server *server;
}
@end
Its superclass contains no C++ code.
When I try to compile it, I have the following errors:
Distributed-CompileC /tmp/MultiMarketsSimulation.build/Development/
PMValentinaAdapter.build/Objects-normal/ppc/PMVAdapter.o /Users/
moetteli/Developer/Source/Aggregates/MultiMarketsSimulation/../../
Frameworks/PMPersistence/Adapters/Valentina/PMVAdapter.mm normal ppc
objective-c++ com.apple.compilers.gcc.4_0
cd /Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation
setenv DISTCC_COMPILER "gcc version 4.0.1 (Apple Computer, Inc.
build 5341)"
setenv DISTCC_HOSTS localhost
setenv DISTCC_SYSTEM "10.4.6 (ppc)"
/usr/bin/distcc /usr/bin/gcc-4.0 -x objective-c++ -arch ppc -
pipe -Wno-trigraphs -fobjc-exceptions -fpascal-strings -fasm-blocks -
O0 -fpermissive -Wreturn-type -Weffc++ -Woverloaded-virtual -Wformat -
Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-
value -Wunknown-pragmas -Wshadow -Wsign-compare -
DVSDK_FRAMEWORK_STYLE -fmessage-length=0 -fobjc-direct-dispatch -
mtune=G5 -ftree-vectorize -fvisibility-inlines-hidden -mfix-and-
continue -gdwarf-2 -I/tmp/MultiMarketsSimulation.build/Development/
PMValentinaAdapter.build/PMValentina.hmap -fpch-preprocess -F/tmp/
Development -I/tmp/Development/include -I/Users/moetteli/VSDK/sources
-I/tmp/MultiMarketsSimulation.build/Development/
PMValentinaAdapter.build/DerivedSources -c /Users/moetteli/Developer/
Source/Aggregates/MultiMarketsSimulation/../../Frameworks/
PMPersistence/Adapters/Valentina/PMVAdapter.mm -o /tmp/
MultiMarketsSimulation.build/Development/PMValentinaAdapter.build/
Objects-normal/ppc/PMVAdapter.o
In file included from /Users/moetteli/VSDK/sources/VShared/FBL/publ/
Headers/FBL.h:104,
from /Users/moetteli/VSDK/sources/VShared/FBL/publ/
Util_classes/FBL_String.h:13,
from /Users/moetteli/VSDK/sources/VShared/VSQL/
Interfaces/VSQL_I_Server.h:13,
from /Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVDBMS.h:10,
from /Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:10:
/Users/moetteli/VSDK/sources/VShared/FBL/publ/Templates/FBL_Array.h:
22: warning: ignoring #pragma warning
/Users/moetteli/VSDK/sources/VShared/FBL/publ/Util_Classes/
FBL_EncryptionKey.h:28: warning: 'class fbl::EncryptionKey' has
pointer data members
/Users/moetteli/VSDK/sources/VShared/FBL/publ/Util_Classes/
FBL_EncryptionKey.h:28: warning: but does not override
'fbl::EncryptionKey(const fbl::EncryptionKey&)'
/Users/moetteli/VSDK/sources/VShared/FBL/publ/Util_Classes/
FBL_EncryptionKey.h:28: warning: or 'operator=(const
fbl::EncryptionKey&)'
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVDBMS.h:14: error: expected unqualified-id before '@' token
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVDBMS.h:20: warning: '@end' must appear in an
@implementation context
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm: In function 'void +[PMVAdapter load]
(objc_object*, objc_selector*)':
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:20: error: 'ValentinaInit' is not a member of
'fbl'
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:21: error: 'ValentinaInitC' is not a member
of 'fbl'
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm: At global scope:
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:25: error: expected type-specifier before
'PMVDBMS'
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:25: error: expected `)' before 'PMVDBMS'
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm: In function '<typeprefixerror>-[PMVAdapter
PMVDBMS](PMVAdapter*, objc_selector*)':
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:25: error: return type '<type error>' is
incomplete
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:25: error: expected `{' before '*' token
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:25: error: expected primary-expression before
')' token
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:25: error: expected `;' before ')' token
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:33: error:
'encoderCreationInvocationForLocation' was not declared in this scope
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:33: error: expected `;' before ':' token
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:43: error:
'deletedObjectInvocationForLocation' was not declared in this scope
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:43: error: expected `;' before ':' token
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:49: error: expected `}' before 'end'
/Users/moetteli/Developer/Source/Aggregates/
MultiMarketsSimulation/../../Frameworks/PMPersistence/Adapters/
Valentina/PMVAdapter.mm:49: warning: control reaches end of non-void
function
distcc[18283] ERROR: compile /Users/moetteli/Developer/Source/
Aggregates/MultiMarketsSimulation/../../Frameworks/PMPersistence/
Adapters/Valentina/PMVAdapter.mm on localhost failed
Interestingly, I can change the order of importing the headers. Then
the error occurs at the declaration of NSObject.
It is as if once, I import this C++ header file, there's no going
back to Objective-C.
I also saw, that there's a VSDK in framework style distributed with
V4CC. But am I right and this framework doesn't contain client
functions, e. g. I_Server?
Will there be or is there already a complete VSDK in framework style
somewhere?
Many thanks for any help!
Phil
More information about the Valentina
mailing list