specific instantiation of static members from template class
hello, I have a problem when I try to instantiate static members. this code works with gcc-3.4.5 but not with gcc-4.0.2 (debian sid). here a test case with 3 files : / main.cpp #include #include "Test.h" int main(int argc, char **argv) { std::cout << TestInt::member << std::endl; return 0; } / test.h template class Test { public: static T member; }; typedef Test TestInt; / test.cpp #include "Test.h" template class Test; template<> int Test::member; I got an error at link because it cannot find the symbol Test::member used in "main.o" If I use only one file, it works. If I give an initial value to Test::member in test.cpp, it works. It works with gcc-3.4.5. I did some research and see that it could works even without the member declaration, the class instantiation should be enough here : http://gcc.gnu.org/ml/gcc/2004-05/msg01393.html Is this a bug or a behavour change from gcc ?
Re: gcc command line exceeds 8191 when building in XP
Tim Prince wrote: On 7/19/2010 4:13 PM, IceColdBeer wrote: Hi, I'm building a project using GNU gcc, but the command line used to build each source file sometimes exceeds 8191 characters, which is the maximum supported command line length under Win XP.Even worst under Win 2000, where the maximum command line length is limited to 2047 characters. Can the GNU gcc read the build options from a file instead ?I have searched, but cannot find an option in the documentation. Thanks in advance, ICB redirecting to gcc-help. The gcc builds for Windows themselves use a scheme for splitting the link into multiple steps in order to deal with command line length limits. I would suggest adapting that. Can't study it myself now while travelling. @file says the manpage. "Read command-line options from file."
gcc 4.1.1 Successful build - Cedric Arbogast
Hello, GCC 4.1.1 have successfully compiled on this system : ./config.guess: i686-pc-linux-gnu GCC_EXEC_PREFIX=/usr/local/gcc411; export GCC_EXEC_PREFIX; gcc -v : Using built-in specs. Target: i686-pc-linux-gnu Configured with: /usr/src/gcc-4.1.1/configure --prefix=/usr/local/gcc411 --enable-threads Thread model: posix gcc version 4.1.1 Linux distribution : Mandrake Linux release 9.0 (dolphin) for i586 Linux Kernel Version (personal build): 2.6.11-Zilog80 glibc version (personal build) : 2.3.2 Other info : Previous gcc version : 3.3 Fine work, regards, Cédric.