Code::Blocks Forums
User forums => Help => Topic started by: srjacob on July 20, 2018, 10:44:26 pm
-
I am having a strange problem and I don't really know how to search for it.
I am using code::blocks on the Raspberry PI. I wrote a small test program and modified an existing GPIO class in order to get to the GPIO pins with a RGB matrix HAT/library that doesn't play well with others.
Anyway, I have the 4 attached programs plus the code::blocks files. When I build them, the linker is looking for a GPIO.o file. This file doesn't exist, but somehow Code::blocks wants to find it I have searched everywhere I know looking for the reference to this file, but I can't find any reference.
Could someone please let me know where code::blocks keeps its file references so I can figure out this problem. I have checked the Project->Build Options and Project->Properties, and can't find anywhere this rogue file is being referenced.
Thanks in advance.
Steve
-
Remove GPIO.cpp from the project or add the file.
Edit: For problems like this I first try [Plugins] -> "Find broken files in project".
Tim S.
-
Thanks. GPIO.cpp was not in the project, so I couldn't remove it. However, Plugins->Find broken files in project succeeded in removing both GPIO.cpp and GPIO.o from the project. How do I find files in the project that have no .cpp files?
I am also getting placed on the link command the library "/home/pi/rpi-rgb-led-matrix/lib/librgbmatrix.a", but I can't find any reference in either the Project->Build options or in the Project->Properties. Does Code::blocks hide this somewhere?
On the build, I am now getting:
-------------- Build: Debug in linktest (compiler: GNU GCC Compiler)---------------
g++ -L/home/pi/linktest/ -L/home/pi/linktest/ -L/home/pi/rpi-rgb-led-matrix/lib -o bin/Debug/linktest obj/Debug/ButtonSetup.o obj/Debug/main.o obj/Debug/SrjGPIO.o -pthread -pthread /home/pi/linktest/obj/Debug /home/pi/rpi-rgb-led-matrix/lib/librgbmatrix.a
/usr/bin/ld: cannot find /home/pi/linktest/obj/Debug: File format not recognized
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
I have gotten this before, and I am not sure why. Could someone please enlighten me on why I am getting "File format not recognized."
-
Likely because you are using the wrong toolchain/linker/compiler.
Edit: Re-read your post more likely you added the wrong search path in the global compiler settings or in the project settings.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Tim S.
-
Please stop putting anything in the link libraries list except for the library name; till you learn more about Code::Blocks and your compiler.
Tim S.