XCode 4.1 / Lion: Expected declaration specifiers
Until yesterday I had no problems using FMDB, but today I upgraded to Lion/xcode4.1 and I get tons of errors before every method declaration in the FMDB Classes like:
"Expected declaration specifiers before '+' token"
Do I miss something here?
I've not seen these errors. Can you paste the whole error message from Xcode?
Thanks for the fast reply, here is the error:
ProcessPCH /Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/PrecompiledHeaders/MyBodyGuard-Prefix-hafyhrybdqfyrwbqwboiyzaaarcz/MyBodyGuard-Prefix.pch.gch MyBodyGuard/MyBodyGuard-Prefix.pch normal i386 objective-c com.apple.compilers.llvmgcc42 cd /Users/tmie/git/xcode/MyBodyGuard setenv LANG en_US.US-ASCII setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -x objective-c-header -arch i386 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -DDEBUG -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -iquote /Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Intermediates/MyBodyGuard.build/Debug-iphonesimulator/MyBodyGuard.build/MyBodyGuard-generated-files.hmap -I/Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Intermediates/MyBodyGuard.build/Debug-iphonesimulator/MyBodyGuard.build/MyBodyGuard-own-target-headers.hmap -I/Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Intermediates/MyBodyGuard.build/Debug-iphonesimulator/MyBodyGuard.build/MyBodyGuard-all-target-headers.hmap -iquote /Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Intermediates/MyBodyGuard.build/Debug-iphonesimulator/MyBodyGuard.build/MyBodyGuard-project-headers.hmap -I/Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Products/Debug-iphonesimulator/include -I/Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Intermediates/MyBodyGuard.build/Debug-iphonesimulator/MyBodyGuard.build/DerivedSources/i386 -I/Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Intermediates/MyBodyGuard.build/Debug-iphonesimulator/MyBodyGuard.build/DerivedSources -F/Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/Products/Debug-iphonesimulator -c /Users/tmie/git/xcode/MyBodyGuard/MyBodyGuard/MyBodyGuard-Prefix.pch -o /Users/tmie/Library/Developer/Xcode/DerivedData/MyBodyGuard-dfcrbzkfzxhtyjfqlchyqhscluzu/Build/PrecompiledHeaders/MyBodyGuard-Prefix-hafyhrybdqfyrwbqwboiyzaaarcz/MyBodyGuard-Prefix.pch.gch
In file included from /Users/tmie/git/xcode/MyBodyGuard/MyBodyGuard/MyBodyGuard-Prefix.pch:14: /usr/include/sqlite3.h: In function 'sqlite3_enable_shared_cache': /usr/include/sqlite3.h:4275: error: expected declaration specifiers before 'AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_5_0' /usr/include/sqlite3.h:4532: error: storage class specified for parameter 'sqlite3_vtab' /usr/include/sqlite3.h:4533: error: storage class specified for parameter 'sqlite3_index_info' /usr/include/sqlite3.h:4534: error: storage class specified for parameter 'sqlite3_vtab_cursor' /usr/include/sqlite3.h:4535: error: storage class specified for parameter 'sqlite3_module' /usr/include/sqlite3.h:4557: error: expected declaration specifiers or '...' before 'sqlite3_vtab' /usr/include/sqlite3.h:4560: error: expected declaration specifiers or '...' before 'sqlite3_vtab' /usr/include/sqlite3.h:4561: error: expected ')' before '' token /usr/include/sqlite3.h:4562: error: expected ';' before 'int' /usr/include/sqlite3.h:4581: warning: empty declaration /usr/include/sqlite3.h:4660: warning: empty declaration /usr/include/sqlite3.h:4705: warning: type defaults to 'int' in declaration of 'sqlite3_module' /usr/include/sqlite3.h:4705: error: expected ';', ',' or ')' before '' token /usr/include/sqlite3.h:4711: warning: type defaults to 'int' in declaration of 'sqlite3_module' /usr/include/sqlite3.h:4711: error: expected ';', ',' or ')' before '*' token /usr/include/sqlite3.h:4735: error: expected ':', ',', ';', '}' or '__attribute' before '' token /usr/include/sqlite3.h:4739: warning: empty declaration /usr/include/sqlite3.h:4759: error: expected specifier-qualifier-list before 'sqlite3_vtab' /usr/include/sqlite3.h:4761: warning: empty declaration /usr/include/sqlite3.h:4813: error: storage class specified for parameter 'sqlite3_blob' /usr/include/sqlite3.h:4878: error: expected declaration specifiers or '...' before 'sqlite3_blob' /usr/include/sqlite3.h:4903: error: expected ')' before '' token /usr/include/sqlite3.h:4927: error: expected ')' before '' token /usr/include/sqlite3.h:4942: error: expected ')' before '' token /usr/include/sqlite3.h:4970: error: expected ')' before '' token /usr/include/sqlite3.h:5008: error: expected ')' before '' token /usr/include/sqlite3.h:5228: error: storage class specified for parameter 'sqlite3_mutex_methods' /usr/include/sqlite3.h:5239: warning: empty declaration /usr/include/sqlite3.h:5674: error: storage class specified for parameter 'sqlite3_pcache' /usr/include/sqlite3.h:5817: error: storage class specified for parameter 'sqlite3_pcache_methods' /usr/include/sqlite3.h:5822: error: expected specifier-qualifier-list before 'sqlite3_pcache' /usr/include/sqlite3.h:5830: warning: empty declaration /usr/include/sqlite3.h:5842: error: storage class specified for parameter 'sqlite3_backup' /usr/include/sqlite3.h:6025: error: expected declaration specifiers before 'sqlite3_backup' /usr/include/sqlite3.h:6031: error: expected ')' before '' token /usr/include/sqlite3.h:6032: error: expected ')' before '' token /usr/include/sqlite3.h:6033: error: expected ')' before '' token /usr/include/sqlite3.h:6034: error: expected ')' before '' token /usr/include/sqlite3.h:6308: error: storage class specified for parameter 'sqlite3_rtree_geometry' /usr/include/sqlite3.h:6319: error: expected ')' before '*' token /usr/include/sqlite3.h:6320: error: expected ';', ',' or ')' before 'void' /usr/include/sqlite3.h:6334: warning: empty declaration In file included from /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:3, from /Users/tmie/git/xcode/MyBodyGuard/MyBodyGuard/MyBodyGuard-Prefix.pch:15: /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:16: error: expected declaration specifiers before 'class' /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:17: error: expected declaration specifiers before 'class' /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:19: error: expected declaration specifiers before 'interface' /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:29: error: expected declaration specifiers before '+' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:31: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:33: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:34: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:36: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:37: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:39: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:41: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:42: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:44: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:46: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:47: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:49: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:50: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:52: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:53: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:55: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:56: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:58: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:59: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:61: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:62: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:64: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:65: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:67: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:68: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:70: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:71: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:73: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:74: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:77: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:78: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:85: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:86: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:88: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:89: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:91: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:92: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMResultSet.h:94: error: expected declaration specifiers before 'end' In file included from /Users/tmie/git/xcode/MyBodyGuard/MyBodyGuard/MyBodyGuard-Prefix.pch:15: /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:22: error: expected declaration specifiers before '+' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:23: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:25: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:27: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:29: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:30: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:31: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:32: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:35: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:36: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:39: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:41: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:43: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:44: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:45: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:47: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:49: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:50: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:51: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:52: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:53: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:55: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:56: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:57: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:58: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:60: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:61: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:62: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:63: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:65: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:66: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:68: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:69: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:71: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:72: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:74: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:75: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:77: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:78: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:80: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:81: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:83: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:84: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:86: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:87: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:89: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:90: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:93: error: expected declaration specifiers before '+' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:95: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:97: error: expected declaration specifiers before 'end' /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:106: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:107: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:109: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:110: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:112: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:113: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:115: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:116: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabase.h:119: error: expected declaration specifiers before 'end' In file included from /Users/tmie/git/xcode/MyBodyGuard/MyBodyGuard/MyBodyGuard-Prefix.pch:16: /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:14: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:15: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:16: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:17: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:18: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:19: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:26: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:27: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:28: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:29: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:31: error: expected declaration specifiers before '-' token /Users/tmie/git/xcode/MyBodyGuard/FMDatabaseAdditions.h:33: error: expected declaration specifiers before 'end' /Users/tmie/git/xcode/MyBodyGuard/MyBodyGuard/MyBodyGuard-Prefix.pch:17: error: old-style parameter declarations in prototyped function definition /usr/include/sqlite3.h:4275: error: parameter name omitted
I have no idea.
I upgraded to xcode 4.2 and it works again.
Issue closed.
hi brother,I also encountered this problem, how did you solve it
I had a similar issue with my own project and fixed it by switching to the Apple LLVM compiler 3.0. Leaving this here for anyone who gets here via google, like I did.
We encountered a similar issue in our project and using a #import <sqlite3.h> instead of #import "/usr/include/sqlite3.h" did the trick.
Thanks to Maria in this post : http://www.linkedin.com/groups/SQLite3-Lion-121874.S.62966926
Not sure this helps, but for others who reach here like me.