
Hi,
Somehow I keep getting exceptions related to the use of strings when I
compile my program in Xcode. If I use strings in my program arguments I get
an bad_any_cast exception from the store() method.
If I compile the same program from the command line directly it works fine,
but I can't seem to figure out what the difference is between the two build
commands that is causing this behavior.
I compiled the program from the command line like this:
g++-4.2 -arch i386 -I/opt/local/include -L/opt/local/lib
-lboost_program_options-mt -o waveform_manbuild main.cpp
Xcode uses the following:
CompileC
build/waveform.build/Release/waveform.build/Objects-normal/i386/main.o
main.cpp normal i386 c++ com.apple.compilers.gcc.4_2
cd /Users/foo/waveform
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe
-Wno-trigraphs -fpascal-strings -fasm-blocks -Os -mdynamic-no-pic
-Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.5.sdk
-fvisibility=hidden -fvisibility-inlines-hidden -mmacosx-version-min=10.5
-gdwarf-2 -iquote
/Users/foo/waveform/build/waveform.build/Release/waveform.build/waveform-generated-files.hmap
-I/Users/foo/waveform/build/waveform.build/Release/waveform.build/waveform-own-target-headers.hmap
-I/Users/foo/waveform/build/waveform.build/Release/waveform.build/waveform-all-target-headers.hmap
-iquote
/Users/foo/waveform/build/waveform.build/Release/waveform.build/waveform-project-headers.hmap
-F/Users/foo/waveform/build/Release
-I/Users/foo/waveform/build/Release/include -I/opt/local/include
-I/Users/foo/waveform/build/waveform.build/Release/waveform.build/DerivedSources/i386
-I/Users/foo/waveform/build/waveform.build/Release/waveform.build/DerivedSources
-c /Users/foo/waveform/main.cpp -o
/Users/foo/waveform/build/waveform.build/Release/waveform.build/Objects-normal/i386/main.o
The (very simple) test program is listed below. I hope someone can spot the
problem. It's driving me nuts.
Cheers,
Thijs
PS: I'm using OS10.6.1 and Xcode 3.2.1
#include <iostream>
#include