This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: file size limit
- From: "Cristian G. Rojas" <cgrojas at ncsu dot edu>
- To: "Grigory Zagorodnev" <grigory_zagorodnev at linux dot intel dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 1 Feb 2006 12:34:38 -0500 (EST)
- Subject: Re: file size limit
- References: <36938.129.33.49.251.1138656455.squirrel@webmail.ncsu.edu> <1869.69.134.185.252.1138663209.squirrel@webmail.ncsu.edu> <43CFAA7E-EE42-4DCD-B9F1-0E84309694DA@gmail.com> <1321.66.26.63.102.1138676643.squirrel@webmail.ncsu.edu> <43DF2A84.9000509@linux.intel.com>
> This test runs fine with g++ 3.4 and higher where Large File Support is
> enabled - check for _GLIBCXX_USE_LFS in bits/c++config.h.
>
> I'd suggest you upgrade the compiler.
>
> - Grigory
>
So I thank you for your help...I have upgraded my compiler to 4.0.2 and now I have what
looks like linking issues. Any help is greatly appreciated.
Here is sample code:
[test]$ more test.cpp
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <ostream>
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
char *filename;
fstream filein;
setbuf(stdout,NULL);
filename = argv[1];
filein.open(filename,fstream::in);
if (filein == NULL)
{
printf("Error opening %s\n",filename);
exit(2);
} else {
printf("File opened correctly %s\n",filename);
}
return 0;
}
-----------------------------------------------------
My makefile:
[test]$ more makefile
DEBUG = true
SHELL = /bin/bash
OBJECTS = test.o
#ifeq ($(DEBUG),true)
OPS = -w -g #-O3
#else
#OPS = -w -O3
#endif
test: $(OBJECTS)
gcc $(OPS)-o test $(OBJECTS)
test.o: test.cpp ; gcc $(OPS) -c test.cpp
clean: $(OBJECTS) test; rm -f $(OBJECTS) test
-----------------------------------------------------
Make results:
[test]$ make
gcc -w -g -o test test.o
test.o(.text+0x2b): In function `main':
/home/test/test.cpp:13: undefined reference to `std::basic_fstream<char,
std::char_traits<char> >::basic_fstream()'
test.o(.text+0x60):/home/test/test.cpp:17: undefined reference to
`std::basic_fstream<char, std::char_traits<char> >::open(char const*,
std::_Ios_Openmode)'
test.o(.text+0x77):/home/test/test.cpp:18: undefined reference to `std::basic_ios<char,
std::char_traits<char> >::operator void*() const'
test.o(.text+0xc7):/home/test/test.cpp:25: undefined reference to
`std::basic_fstream<char, std::char_traits<char> >::~basic_fstream()'
test.o(.text+0xed):/home/test/test.cpp:25: undefined reference to
`std::basic_fstream<char, std::char_traits<char> >::~basic_fstream()'
test.o(.text+0x123): In function `__tcf_0':
/usr/lib/gcc/i386-redhat-linux/4.0.2/../../../../include/c++/4.0.2/iostream:76:
undefined reference to `std::ios_base::Init::~Init()'
test.o(.text+0x150): In function `__static_initialization_and_destruction_0':
/usr/lib/gcc/i386-redhat-linux/4.0.2/../../../../include/c++/4.0.2/iostream:76:
undefined reference to `std::ios_base::Init::Init()'
test.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [test] Error 1
------------------------------------------------------
GCC details:
[test]$ gcc --version
gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
------------------------------------------------------
System Details:
[cgrojas@spiral2 test]$ uname -s -r -v -o
Linux 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT 2005 GNU/Linux