Re: C++ Constructors on global vars not being run ?
Re: C++ Constructors on global vars not being run ?
- Subject: Re: C++ Constructors on global vars not being run ?
- From: Michael Wild <email@hidden>
- Date: Mon, 24 Sep 2007 11:10:56 +0200
Apparao wrote:
Look at the GCC command (which uses Xcode) in the Build transcript and
compare this with your GCC on the command line.
On Sep 24, 2007, at 10:44 AM, Peter Mulholland wrote:
Further to this:
Compiled that under gcc on the command line and it worked. Similar thing
doesn't work in Xcode.
--
Best regards,
Peter mailto:email@hidden
Just compiled the provided snippet both in Xcode (C++ command line
utility) and from the command line using g++. Works fine in both cases.
Using Xcode 2.4.
The output of "$ xcodebuild -configuration Debug":
=== BUILDING NATIVE TARGET ctor WITH CONFIGURATION Debug ===
Checking Dependencies...
CompileC build/ctor.build/Debug/ctor.build/Objects-normal/i386/test.o
/Volumes/Data/Users/mwild/tmp/cxx/ctor/test.cpp normal i386 c++
com.apple.compilers.gcc.4_0
cd /Volumes/Data/Users/mwild/tmp/cxx/ctor
/usr/bin/gcc-4.0 -x c++ -arch i386 -pipe -Wno-trigraphs
-fpascal-strings -fasm-blocks -g -O0 -Wreturn-type -Wunused-variable
-fmessage-length=0 -fvisibility=hidden -fvisibility-inlines-hidden
-mfix-and-continue -mmacosx-version-min=10.4
-I/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/ctor.build/Debug/ctor.build/ctor.hmap
-F/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/Debug
-I/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/Debug/include
-I/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/ctor.build/Debug/ctor.build/DerivedSources
-isysroot /Developer/SDKs/MacOSX10.4u.sdk -c
/Volumes/Data/Users/mwild/tmp/cxx/ctor/test.cpp -o
/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/ctor.build/Debug/ctor.build/Objects-normal/i386/test.o
Ld /Volumes/Data/Users/mwild/tmp/cxx/ctor/build/Debug/ctor normal i386
cd /Volumes/Data/Users/mwild/tmp/cxx/ctor
/usr/bin/g++-4.0 -o
/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/Debug/ctor
-L/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/Debug
-F/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/Debug -filelist
/Volumes/Data/Users/mwild/tmp/cxx/ctor/build/ctor.build/Debug/ctor.build/Objects-normal/i386/ctor.LinkFileList
-arch i386 -Wl,-Y,1455 -mmacosx-version-min=10.4 -isysroot
/Developer/SDKs/MacOSX10.4u.sdk
** BUILD SUCCEEDED **
And the output of that snippet "$ build/Debug/ctor":
In constructor for something()
atest.somevar is 123
HTH
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden