Carbon.h precompile error

I am trying to look at some avsys examples on sound analysis but can’t get it to compile because of the errors below. This has happened on other projects and can’t figure out what is causing this. It has something to do with carbon.h but I don’t know what?

Thanks for your help!

/Developer/usr/bin/gcc-4.0 -x c+±header -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mfix-and-continue -Wno-deprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.4 -gdwarf-2 -I/Users/mattschulz/Desktop/of_preRelease_v0.06_xcode_FAT/apps/myApps/aubioExample/build/openFrameworks.build/Debug/openFrameworks.build/openFrameworksDebug.hmap -F/Users/mattschulz/Desktop/of_preRelease_v0.06_xcode_FAT/apps/myApps/aubioExample -I/Users/mattschulz/Desktop/of_preRelease_v0.06_xcode_FAT/apps/myApps/aubioExample/include -I…/…/…/libs/poco/include -I…/…/…/libs/poco/include/Poco -I…/…/…/libs/poco/include/Poco/CppUnit -I…/…/…/libs/poco/include/Poco/DOM -I…/…/…/libs/poco/include/Poco/Net -I…/…/…/libs/poco/include/Poco/SAX -I…/…/…/libs/poco/include/Poco/Util -I…/…/…/libs/poco/include/Poco/XML -I…/…/…/libs/fmodex/inc -I…/…/…/libs/openFrameworks -I…/…/…/libs/openFrameworks/app -I…/…/…/libs/openFrameworks/communication -I…/…/…/libs/openFrameworks/events -I…/…/…/libs/openFrameworks/graphics -I…/…/…/libs/openFrameworks/sound -I…/…/…/libs/openFrameworks/utils -I…/…/…/libs/openFrameworks/video -I…/…/…/libs/freeimage/include -I…/…/…/libs/freetype/include -I…/…/…/libs/freetype/include/freetype2 -I…/…/…/libs/freetype/include/freetype2/freetype -I…/…/…/libs/freetype/include/freetype2/freetype/cache -I…/…/…/libs/freetype/include/freetype2/freetype/config -I…/…/…/libs/freetype/include/freetype2/freetype/internal -I…/…/…/libs/GLee/include -I…/…/…/libs/rtAudio/include -I/Users/mattschulz/Desktop/of_preRelease_v0.06_xcode_FAT/apps/myApps/aubioExample/build/openFrameworks.build/Debug/openFrameworks.build/DerivedSources -D__MACOSX_CORE__ -lpthread -c /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h -o /var/folders/u3/u35YfTaYEBuT1wUh0vS-Uk+++TM/-Caches-/com.apple.Xcode.502/SharedPrecompiledHeaders/Carbon-dupudnmvzcgznnfuzdbyldhdupgi/Carbon.h.gch
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:79: error: ‘::memcpy’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:80: error: ‘::memmove’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:81: error: ‘::strcpy’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:82: error: ‘::strncpy’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:83: error: ‘::strcat’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:84: error: ‘::strncat’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:85: error: ‘::memcmp’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:86: error: ‘::strcmp’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:87: error: ‘::strcoll’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:88: error: ‘::strncmp’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:89: error: ‘::strxfrm’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:90: error: ‘::strcspn’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:91: error: ‘::strspn’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:92: error: ‘::strtok’ has not been declared

/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:93: error: ‘::memset’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:94: error: ‘::strerror’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:95: error: ‘::strlen’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:97: error: ‘::memchr’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring: In function ‘void* std::memchr(void*, int, size_t)’:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:101: error: invalid conversion from ‘const void*’ to ‘void*’
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:101: error: initializing argument 1 of ‘void* std::memchr(void*, int, size_t)’
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring: At global scope:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:103: error: ‘::strchr’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:109: error: ‘::strpbrk’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:115: error: ‘::strrchr’ has not been declared
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/cstring:121: error: ‘::strstr’ has not been declared

Did you, by ant chance, move files around. I have the same problem after moving my project from the apps/examples directory to another. I restored all linkage to all files and paths, but i get the same errors. The project from the apps/examples folder does compile, so it seems to be a path error. Anybody any ideas?

I just fixed it for me. I had added the libs/poco/include directory to my project and that generated errors. Removed the reference to it, in my case at least.

this suddenly happened to me too. example files still compile fine. i don’t understand why removing the libs/poco/include path would fix anything. you’re talking about the Header Search Path in Project Settings, right? if it’s just a search path, rather than a path to an actual/required file, why would removing it fix anything? in any case, i tried removing it and i still get similar errors

error: ‘::memcpy’ has not been declared
error: ‘::memmove’ has not been declared
etc…

but now i also get this above it:

error: Poco/Foundation.h: No such file or directory

there’s a list of indented files listed above that, starting with

Precompiling /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h (32 errors)

i’m lost… thanks for any help,

eric

I didn’t mean removing it from your search paths (as you can see it now can’t find it).

I accidently added the files to the project (i can browse to them in the left column of xCode). After removing those files it worked again for me. I guess it has something to do in the order in which the files are compiled.

i found a backup copy of the app in question and it still works. i changed no code, just moved it around to different folders. somehow that messed things up, even though i put it back in the original folder. i compared them side by side and can find no differences in iibraries, project settings, paths, etc. and since the backup works, i don’t really need to care. but i’d like to know just because as an xCode newbie, its structure and errors are so often inscrutable. the only thing i found different is when i click on the top openFrameworks group in the Groups & Files column (the top blue application icon with openFrameworksDebug.app and .plist in it), i see a LOT of extra files in the version that *doesn’t* work.

working group contents:

3Dobject.h
AGL.frameworks
ApplicationServices.framework
asio.h
etc…

non-working group contents:

3Dobject.h
AbstractCache.h
AbstractConfiguration.h
etc…
(15 files)

AGL.framework
Any.h
Application.h
ApplicationServices.framework
ArchiveStrategy.h
ASCIIEncoding.h
asio.h
etc…

it seems the contents of Poco somehow got dumped redundantly in there somehow? and where is “there”? not really sure what that top openFrameworks group shows you - is it the contents of every file and folder underneath it? apparently not, or it would show those files in my working version too, since it also has Poco under libs/core/core libraries/poco. confusing…

ahh… i see now. sort of. i looked in libs/core/core libraries/poco but i didn’t continue to look deeper. somehow in poco/ there is not only the lib folder but also the include folder and install.txt. when i delete those references, it compiles. i wonder how we both ended up doing that same thing…

thanks.

For me it happened as well when i moved things around: I had to re-link all the libraries and imported them again, accidently also adding those unneeded (en compile-breaking) headers.

not that i need to know this, but i’m curious - why *doesn’t* the poco/include folder have to explicitly listed in Groups & Files? it has all its .h files in the Poco folder inside it. i thought every file needed to be there. the other libraries in the core frameworks folder all have their “include” folders listed.

you know what i would love. a screenshot of the correct (or “best practice”) folder structure of everything xCode/openFrameworks related. the tutorials do a shameful job of telling you where to put things, even the first-timers download and install guides don’t tell you clearly. it’s very confusing. like, the openframeworks libs folder shouldn’t be merged with the libs folders inside your xCode folder (which can be anywhere, i think), and that libs folder has another folder called openframeworks inside it! and you can’t name your applications whatever you like without a big to-do, so everything is called openFrameworks.xcodeproj, so when you have more than one project opened at once in xcode you can’t tell which is which easily. and so on…

this is because Poco has relative include paths:

ie: #include “Poco/Net/Something.h”

If we added the files to the xcode sidebar then xcode would know about “Something.h” as just “Something.h” so the above include wouldn’t work.

So instead we add “…/…/…/libs/poco/include” to our project settings search path - so when it looks for Poco/Net/Something.h it finds it as that path is correct relative to …/…/…/libs/poco/include .

Normally we just add the files to the sidebar / project directly but this was an exception.

Theo

hi

i had the same poco problem

and placing the project folder in apps/examples
+
adding …/…/…/libs/poco/include to the header search path got rid of the poco error message.

BUT
i still get these error messages

‘::memcpy’ has not been declared
‘::strncpy’ has not been declared

any clue why and how to solve this?

thanks,
stephan

[quote author=“heartstring”]I am trying to look at some avsys examples on sound analysis but can’t get it to compile because of the errors below. This has happened on other projects and can’t figure out what is causing this. It has something to do with carbon.h but I don’t know what?

Thanks for your help! [/quote]

Here is the Solution: in the Header Search Paths dialog of Xcode, uncheck the “Recursive”.

[quote author=“jimbozhang”][quote author=“heartstring”]I am trying to look at some avsys examples on sound analysis but can’t get it to compile because of the errors below. This has happened on other projects and can’t figure out what is causing this. It has something to do with carbon.h but I don’t know what?

Thanks for your help! [/quote]

Here is the Solution: in the Header Search Paths dialog of Xcode, uncheck the “Recursive”.[/quote]

This I did and I keep throwing the following errors:

Precompiling / Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h
error: ‘:: memcpy’ has Not Been Declared
error: ‘:: memmove’ has Not Been Declared

if anyone knows how to fix please help

Thank you.

PS: I’m not very good with English.

Hi, I just ran into this problem, as well, while reconfiguring a project. The issue is that Poco has a String.h file. When you have the include folder for Poco in the “Library search paths” list of the xcode project, the core files will wind up trying to use Poco’s String.h when they #include <string.h>. Apparently, this is implementation dependent, so the angle-brackets don’t necessarily mean that it will search system paths first.

I fixed the problem by putting all of the OF include paths in the “User Header Search Paths” field, instead.