• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NULL pointer value for device name when compiling with no "-arch i386"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NULL pointer value for device name when compiling with no "-arch i386"


  • Subject: NULL pointer value for device name when compiling with no "-arch i386"
  • From: Dodo <email@hidden>
  • Date: Tue, 12 May 2015 00:46:57 +0200

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



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Getting packets from ima4 file
  • Next by Date: Getting NULL pointer value for device name when compiling with no "-arch i386"
  • Previous by thread: Re: Getting packets from ima4 file
  • Next by thread: Getting NULL pointer value for device name when compiling with no "-arch i386"
  • Index(es):
    • Date
    • Thread