User forums > Help
crt2.o: No such file or directory
SilverKobra:
Hello everyone,
Whenever I build a cpp file I get the following error: ld.exe||cannot find crt2.o: No such file or directory|
I'm confused because I didn't apply changes of any sort to code::blocks files, the same programs that now are giving this error used to build and run just fine. In particular it happened that I was writing some code and when I built it the first time everything went fine, I just closed the PC and when I re opened the file later and built it again to make sure it worked (without changing anything) it gave the error I wrote at the beginning of the post and it seems to have ''spread'' to every other cpp file I try to build in code::blocks.
I tried to look for the crt2.o file in the original folder of C.B. but I didn't find anything (of course). I'm thinking of re installing C.B. but if the problem can be solved in other ways (if re installing cb is even a solution) I'd prefer that. Any help would be great
edit01: I've also noted that after building unsuccessfully a cpp file two files called project_name.depend and project_name.layout are created in the project folder, which didn't use to happen before.
I'm using the GNU GCC Compiler.
stahta01:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
Edit1: Unless you post a build log, I will ignore your post as a waste of my time. Because without the build log I see no way to help you.
Tim S.
SilverKobra:
--- Quote from: stahta01 on August 05, 2019, 04:41:28 am ---http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
Edit1: Unless you post a build log, I will ignore your post as a waste of my time. Because without the build log I see no way to help you.
Tim S.
--- End quote ---
Here's the build log:
-------------- Build: Debug in Math (compiler: GNU GCC Compiler)---------------
x86_64-w64-mingw32-g++.exe -o bin\Debug\Math.exe obj\Debug\main.o
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find crt2.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 2 second(s))
1 error(s), 0 warning(s) (0 minute(s), 2 second(s))
BlueHazzard:
Make a rebuild as exactly described in the FAQ and post the log here... Also (as described in the faq) use code tags to post your build log. This is probably not enough information to help you
Blind guess: your file extension is .c instead of .cpp?
SilverKobra:
No my extension is .cpp
Code::Blocks version 13.12 on Windows 10 (version 1803). The compiler I use is GNU GCC Compiler version 5.1.0
Build log:
--- Code: ---
-------------- Clean: Debug in Math (compiler: GNU GCC Compiler)---------------
Cleaned "Math - Debug"
-------------- Build: Debug in Math (compiler: GNU GCC Compiler)---------------
x86_64-w64-mingw32-g++.exe -Wall -fexceptions -g -std=c++11 -c D:\UTENTI\Pietro\Desktop\Math\main.cpp -o obj\Debug\main.o
x86_64-w64-mingw32-g++.exe -o bin\Debug\Math.exe obj\Debug\main.o
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find crt2.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 6 second(s))
1 error(s), 0 warning(s) (0 minute(s), 6 second(s))
--- End code ---
Crash report:
Code::Blocks didn't crash
Navigation
[0] Message Index
[#] Next page
Go to full version