2010-03-13 24 views
23

Estoy haciendo un proyecto que debe compilarse en Windows y Linux. Hice el proyecto en Visual Studio y luego hice un makefile para Linux. Creé todos los archivos en Windows con VS.cc1plus: error: incluir: valor demasiado grande para el tipo de datos definido al compilar con g ++

Se compila y funciona perfectamente en VS, pero cuando ejecuto el archivo MAKE y se ejecuta g ++ consigo

$ g++ -c -I include -o obj/Linux_x86/Server.obj src/Server.cpp 
cc1plus: error: include: Value too large for defined data type 
cc1plus: error: src/Server.cpp: Value too large for defined data type 

El código no es más que un cajero automático de Hello World. Solo quería asegurarme de que todo estaba funcionando antes de comenzar el desarrollo. Intenté buscar pero fue en vano.

Cualquier ayuda sería apreciada.

+2

No obtendrás una respuesta sin revelar tu código, sospecho. –

+0

¿Puedes publicar el código de la línea de la que se queja? Además, ¿qué g ++ para Windows estás usando? MinGW, cygwin, ...? – pajton

+0

Esto se está ejecutando en Linux. Esa es toda la salida que obtengo. –

Respuesta

33

he encontrado una solución en Ubuntu al menos. Yo, como has notado que el error solo ocurre en acciones de samba montadas, parece provenir de g ++ 'stat'ing el archivo, el inodo devuelve un valor muy grande.

Al montar la cuota de añadir, nounix, noserverino a las opciones, es decir:

mount -t cifs -o user=me,pass=secret,nounix,noserverino //server/share /mount 

encontré la información en http://bbs.archlinux.org/viewtopic.php?id=85999

+0

Gracias, eso parece haber funcionado. –

+1

La opción 'nounix' no debería ser necesaria. Puedes usar solo la opción 'noserverino'.Usé ambas opciones y cuando estaba compilando un proyecto grande, todos los archivos fueron compilados y no solo los modificados. – Jleuleu

-1

Creo que sus parámetros de g ++ están un poco apagados, o conflictivos.

-c solamente la compilación
-I directorio de su incluye (simplemente incluir podría ser ambigua. Trate ruta completa)
-o archivo de salida (pero -c dice solamente la compilación)

+0

Creo que confundes '-c' con' -fsyntax-only'. –

1

GNU Core Utils:

27 Value too large for defined data type

It means that your version of the utilities were not compiled with large file support enabled. The GNU utilities do support large files if they are compiled to do so. You may want to compile them again and make sure that large file support is enabled. This support is automatically configured by autoconf on most systems. But it is possible that on your particular system it could not determine how to do that and therefore autoconf concluded that your system did not support large files.

The message "Value too large for defined data type" is a system error message reported when an operation on a large file is attempted using a non-large file data type. Large files are defined as anything larger than a signed 32-bit integer, or stated differently, larger than 2GB.

Many system calls that deal with files return values in a "long int" data type. On 32-bit hardware a long int is 32-bits and therefore this imposes a 2GB limit on the size of files. When this was invented that was HUGE and it was hard to conceive of needing anything that large. Time has passed and files can be much larger today. On native 64-bit systems the file size limit is usually 2GB * 2GB. Which we will again think is huge.

On a 32-bit system with a 32-bit "long int" you find that you can't make it any bigger and also maintain compatibility with previous programs. Changing that would break many things! But many systems make it possible to switch into a new program mode which rewrites all of the file operations into a 64-bit program model. Instead of "long" they use a new data type called "off_t" which is constructed to be 64-bits in size. Program source code must be written to use the off_t data type instead of the long data type. This is typically done by defining -D_FILE_OFFSET_BITS=64 or some such. It is system dependent. Once done and once switched into this new mode most programs will support large files just fine.

See the next question if you have inadvertently created a large file and now need some way to deal with it.

+0

Obtenía el error "Valor demasiado grande para tipo de datos definidos", tratando de llamar a la estadística. Agregar #define _FILE_OFFSET_BITS 64 a mi código resolvió el problema. –

2

tuve un problema similar. Recopilé un proyecto en un recurso compartido de samba montado en CIFS. Con un kernel de Linux se realizó la compilación, pero usando otro kernel de Linux (2.6.32.5), recibí un mensaje de error similar: "Valor demasiado grande para el tipo de datos definido". Cuando utilicé la opción de montaje de CIFS propuesta "nounix, noserverino", el problema se solucionó. Entonces, en ese caso, hay un problema con el montaje de CIFS, por lo que el mensaje de error es engañoso, ya que no hay archivos grandes.

Cuestiones relacionadas