If you have already received this email, just discard it and accept my apologies.
Hi,
I’m having a trouble to run a routine that retrieves the input and output devices.
Specifically, if I compile the routine with the following command:
g++ -arch i386 -fPIC -c -Wall -o device_list.o device_list.cpp g++ -arch i386 -framework AudioUnit -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -I/usr/local/include \ -o device_list.exe device_list_main.cpp device_list.o
everything works fine, but if I compile this very source with a project that does not use the “-arch i386” option, the binary starts but doesn’t work fine. More precisely, in the following snippet, the status is fine but the deviceName is NULL:
CFStringRef deviceName = NULL; dataSize = sizeof(deviceName); propertyAddress.mSelector = kAudioDevicePropertyDeviceNameCFString; status = AudioObjectGetPropertyData(audioDevices[i], &propertyAddress, 0, NULL, &dataSize, &deviceName); if(kAudioHardwareNoError != status) { fprintf(stderr, "AudioObjectGetPropertyData (kAudioDevicePropertyDeviceNameCFString) failed: %i\n", status); continue; }
More, the project in which I need to compile this routine with, has been compiled without the “-arch i386” option.
I’m using OS X 10.10.3 and g++ Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
Thanx in advance.
Cheers
Dodo |