0
0

I am working on an iPhone app where I want to use the [url:1xih6rs8]http://code.google.com/p/cocoaasyncsocket/[/url:1xih6rs8] library. But this requires the app to be compiled in Objective C while Fmod is using C++. I read somewhere that there is a wrapper for Fmod to compile to Objective C. What files should I use then? 😛

Thank you!

  • You must to post comments
0
0

Hi, actually, I’m having the same issue "Undefined Symbol", with the correct libraries linked as follows
[code:2fwzodkn]Ld /Users/Operations/Library/Developer/Xcode/DerivedData/AppSingle1-grlssfyrvwtlbofohpymmrdwlrjn/Build/Products/Debug-iphonesimulator/AppSingle1.app/AppSingle1 normal i386
cd /Users/Operations/Documents/Proyectos/Moenia/AppSingle1
setenv MACOSX_DEPLOYMENT_TARGET 10.6
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/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk -L/Users/Operations/Library/Developer/Xcode/DerivedData/AppSingle1-grlssfyrvwtlbofohpymmrdwlrjn/Build/Products/Debug-iphonesimulator "-L/Developer/Applications/FMOD Programmers API/api/lib" -F/Users/Operations/Library/Developer/Xcode/DerivedData/AppSingle1-grlssfyrvwtlbofohpymmrdwlrjn/Build/Products/Debug-iphonesimulator -filelist /Users/Operations/Library/Developer/Xcode/DerivedData/AppSingle1-grlssfyrvwtlbofohpymmrdwlrjn/Build/Intermediates/AppSingle1.build/Debug-iphonesimulator/AppSingle1.build/Objects-normal/i386/AppSingle1.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework CoreAudio -lfmodex_iphonesimulator -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AudioToolbox -o /Users/Operations/Library/Developer/Xcode/DerivedData/AppSingle1-grlssfyrvwtlbofohpymmrdwlrjn/Build/Products/Debug-iphonesimulator/AppSingle1.app/AppSingle1

Undefined symbols for architecture i386:
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in libfmodex_iphonesimulator.a(fmod.o)
[/code:2fwzodkn]

5 references total. All in libfmodex_iphonesimulator.a

Any ideas of why is this happening? Thanks!

  • You must to post comments
0
0

you can intermix both (C++ and Objective-C) line by line.

  • You must to post comments
0
0

It looks like you are compiling your code as C instead of C++.
The linker is missing the standard C++ library.

  • You must to post comments
0
0

As I understand it I need to have my files names .mm in order for it to be able to run Fmod properly on the iPhone? And the socket library complains when renamed to .mm.

  • You must to post comments
0
0

Thanks Matthew, problem solved!

  • You must to post comments
0
0

ohh, sorry let me clarify it a bit….

.m files are for objective-c
.mm files are for objective-c++

That means in case you use fmodex’ C++ interface you’ll need .mm files and if you use the C interface you’ll probably need .m files.
Actually, you can tweak the compiler to compiler .m files as Objective-C++, but it’s the same as renaming.
If your UDP library is not O-C++ compatible you can either port it or just use the fmod-C interface. I’m sure it works like it’s working on macosx, windows and linux.

  • You must to post comments
0
0

I created a tutorial about how to set up Fmod with xCode. Good note for future development: http://www.sundh.com/blog/2011/08/set-u … -in-xcode/

  • You must to post comments
0
0

I see, so there are 2 ways. I can’t find library files or code for Fmod in C for iPhone. Do you know where to find them? In the manual it references C code but it doesn’t work with the fmod.h files. Is this the best way to go by it or should I focus on getting my UDP library to work in Objective C?

Cheers,

  • You must to post comments
0
0

I am using the event system in Fmod. Does that effect which wrapper I should use?

  • You must to post comments
0
0

For the event system you should use fmod_event.h (for C) and fmod_event.hpp (for C++).

  • You must to post comments
0
0

I tried to include "fmod_event.h" with the following code just to see if I got it working. All my m files are named .m.

[code:2x5ogj9d]FMOD_EventSystem_Create(&eventSystem);[/code:2x5ogj9d]

It gives me the following error:
[code:2x5ogj9d]
Ld /Users/ellensundh/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator/CFmodTest.app/CFmodTest normal i386
cd "/Applications/FMOD Programmers API/examples/CFmodTest"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
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 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/ellen/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator -L../../fmoddesignerapi/api/lib -L../../api/lib -F/Users/ellen/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator -filelist /Users/ellensundh/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Intermediates/CFmodTest.build/Debug-iphonesimulator/CFmodTest.build/Objects-normal/i386/CFmodTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework AudioToolbox -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/ellensundh/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator/CFmodTest.app/CFmodTest

Undefined symbols for architecture i386:
"_FMOD_EventSystem_Create", referenced from:
-[CFmodTestViewController viewDidLoad] in CFmodTestViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
[/code:2x5ogj9d]

I havn’t seen any example of Fmod eventsystem in C compiled to iPhone on the net so it would be really helpful with instructions.

Thank you,
Ellen

  • You must to post comments
0
0

I can’t see anywhere on that command line where you have linked with the simulator version of FMOD, hence the missing symbols.

  • You must to post comments
0
0

I added it now but still get errors: Is it a problem in libfmodex_iphonesimulator.a?
[code:3ii20e7c]
Ld /Users/ellen/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator/CFmodTest.app/CFmodTest normal i386
cd "/Applications/FMOD Programmers API/examples/CFmodTest"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
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 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/ellen/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator "-L/Applications/FMOD Programmers API/fmoddesignerapi/api/lib" "-L/Applications/FMOD Programmers API/api/lib" -F/Users/ellen/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator -filelist /Users/ellen/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Intermediates/CFmodTest.build/Debug-iphonesimulator/CFmodTest.build/Objects-normal/i386/CFmodTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lfmodex_iphonesimulator -lfmodevent_iphonesimulator -framework AudioToolbox -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/ellen/Library/Developer/Xcode/DerivedData/CFmodTest-gnewwgtgyoyuaoguodsiqjbohbsv/Build/Products/Debug-iphonesimulator/CFmodTest.app/CFmodTest

Undefined symbols for architecture i386:
"___cxa_guard_acquire", referenced from:
FMOD::CodecAudioQueue::getDescriptionEx() in libfmodex_iphonesimulator.a(fmod_codec_audioqueue.o)
FMOD::CoreSegment::init(unsigned int, unsigned int, unsigned int, FMOD::Segment::TimeSignature, float, float, unsigned int, FMOD::PlayMode*, unsigned int, FMOD::CoreMusicSample*)in libfmodevent_iphonesimulator.a(fmod_compositionentities.o)
FMOD::CoreSegmentRepository::readChunk(FMOD::ChunkHeader const&, FMOD::File*, unsigned int)in libfmodevent_iphonesimulator.a(fmod_compositionentities.o)
FMOD::PlayModeRandom::instance() in libfmodevent_iphonesimulator.a(fmod_compositionentities.o)
FMOD::PlayModeSequential::instance() in libfmodevent_iphonesimulator.a(fmod_compositionentities.o)
FMOD::PlayMode::createState(int, FMOD::PlayModeState**)in libfmodevent_iphonesimulator.a(fmod_compositioncore.o)
FMOD::PlayModeSequential::clone(FMOD::PlayMode**) constin libfmodevent_iphonesimulator.a(fmod_compositioncore.o)
...[/code:3ii20e7c]

  • You must to post comments
0
0

You also need to link with CoreAudio.framework.

I would recommend checking out the "Getting started with FMOD for iPhone" PDF we ship in the documentation directory. It has useful info like what to link and hardware functionality described.

  • You must to post comments
Showing 14 results
Your Answer

Please first to submit.