1

My Qt Creator is 4.11 which is based on Qt 5.14 in Ubuntu 17.04. Due to ongoing development, I have not updated Qt Creator and Ubuntu to avoid disturbing the working setup.

Whenever I run it in Debug build mode, it compiles fine and runs the executable. But then if I check the "build--*" directory, the binary file (viz. .exe) disappears and all the .o file created from .cpp files shrink to 18 bytes from few MBs!!

Have searched online, but couldn't find such unique problem. Currently the workaround is to clean-build every time, with painful long wait.

Kindly suggest which configuration will fix this issue?

Update:

With some help from the comment section, another distinguishing detail has surfaced. When I visit the build-* folder for a good project & this project and check file main.o in terminal then following output comes

good project: _main.o: ELF 64-bit LSB relocatable, x86-64, version 1 (GNU/Linux), not stripped

bad (this) project:_main.o: gzip compressed data, from NTFS filesystem (NT)

iammilind
  • 68,093
  • 33
  • 169
  • 336
  • Why binary file has `.exe` extension, do you cross-compile for windows? – mugiseyebrows Jun 02 '21 at 12:45
  • @mugiseyebrows, no it's without any extension. I have just made it clear for the Windows users that it's equivalent to .exe. My project is purely compiled for the Ubuntu. However we compile for other OS too separately. – iammilind Jun 02 '21 at 12:58
  • What 'type' are the 18 byte files? That is, what is the output from e.g. `file something.o`? Are they all identical? – G.M. Jun 02 '21 at 16:08
  • @G.M., they are various object files created out of developer written .cpp source files. Interestingly this issue happens with particular project's DEBUG mode. It's not seen for other project in the sibling directory. – iammilind Jun 02 '21 at 16:19
  • So *after* the object files have been truncated to 18 bytes running `file` on them still outputs something like `ELF 64-bit LSB relocatable, x86-64, version 1`? – G.M. Jun 02 '21 at 16:25
  • @G.M., sorry I missed this in your last comment. Interestingly such output comes for other projects which don't have this issue. However for this project it comes as: `main.o: gzip compressed data, from NTFS filesystem (NT)`. I feel something wrong with my settings. – iammilind Jun 03 '21 at 05:24

1 Answers1

0

This issue is not related to Qt, but related to our own code. We have a module which Gzips all files in a given directory recursively.

However, if the directory path is empty, then original binary's path is taken as a zipping directory. Hence all the object files were zipped and somehow the binary file itself was disappearing.

I have put a necessary check and now this will be avoided.


Thanks to user @G.M. who asked me in the comments section to run command file <filename>. From that I got the hint that instead of below output:

ELF 64-bit LSB relocatable, x86-64, version 1

it was giving gzip output:

gzip compressed data, from NTFS filesystem (NT)

This led me to believe that there has to be something with our recently added Gzip mechanism.

iammilind
  • 68,093
  • 33
  • 169
  • 336