Re: file size limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux