-1

I am working on simple program of grayscaling using Opencl. When i compile, it gives me the following error.

make all 
Building file: ../Test1.cpp
Invoking: GCC C++ Compiler 4.9.3 [armeb-linux-gnueabihf]
armeb-linux-gnueabihf-g++ -I/opt/AMDAPPSDK-3.0-0-Beta/include/ -I/opt/AMDAPPSDK-3.0-0-Beta/include/CL -I/opt/AMDAPPSDK-3.0-0-Beta/include/GL -I/opt/AMDAPPSDK-3.0-0-Beta/include/SDKUtil -I/usr/local/include -O0 -g3 -Wall -c -fmessage-length=0 -o -MM -MMD -MP -MF"Test1.d" -MT"Test1.d" -o "Test1.o" "../Test1.cpp"
cc1plus: fatal error: Test1.d: No such file or directory
compilation terminated.
make: *** [Test1.o] Error 1

Compiler command with options:-

armeb-linux-gnueabihf-g++ -I/opt/AMDAPPSDK-3.0-0-Beta/include/ -I/opt/AMDAPPSDK-3.0-0-Beta/include/CL -I/opt/AMDAPPSDK-3.0-0-Beta/include/GL -I/opt/AMDAPPSDK-3.0-0-Beta/include/SDKUtil -I/usr/local/include -O0 -g3 -Wall -c -fmessage-length=0 -o -MM
aval
  • 57
  • 8
Akash
  • 103
  • 1
  • 14

1 Answers1

0

The actual command that is executed seems to have the output option -o twice. This option is supposed to be followed by a filename.

Please remove the output option -o from your command because eclipse seems to automatically add it.

KompjoeFriek
  • 3,572
  • 1
  • 22
  • 35
  • Invoking: GCC C++ Linker 4 [arm-linux-gnueabihf] arm-linux-gnueabihf-g++ -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -o "Grayscale" ./Test1.o /usr/lib/x86_64-linux-gnu/libm.so: file not recognized: File format not recognized collect2: error: ld returned 1 exit status make: *** [Grayscale] Error 1 It is still giving this error.... – Akash Sep 21 '15 at 15:15
  • This is actually a very different error. I think the previous command might have created a `Test1.o` with the format of `Test1.d`. Would recommend to do a full clean before trying to compile again. – KompjoeFriek Sep 21 '15 at 23:07
  • I have removed the path to that library in eclipse and added specific library of opencv. Now its showing: - armeb-linux-gnueabihf-g++ -L/usr/local/lib -L/opt/AMDAPPSDK-3.0-0-Beta/lib/x86_64 -o "Grayscale" ./Test1.o -lopencv_core /usr/local/lib/libopencv_core.so: file not recognized: File format not recognized collect2: error: ld returned 1 exit status make: *** [Grayscale] Error 1 – Akash Sep 22 '15 at 11:22
  • The last part: `/usr/local/lib/libopencv_core.so` is telling g++ to try and link with that exact file. However, you are also telling g++ to find `libopencv_code.so` with the command `-lopencv_code` (which is should find because you also specified the path to look with `-L/usr/local/lib`). One last question: Are you currently building/compiling this on an `ARM` machine? if you are not, i highly doubt the `.so` files in /usr/local/lib are intended for an `ARM` machine. – KompjoeFriek Sep 23 '15 at 00:00
  • If I am not providing link to specifically to -lopencv_core.so , then the opencv libraries used in the code i.e. cvloadimage etc are not resolved. And no right now i am not compiling on the ARM but yes I have to cross compile on the arm machine. Any suggestions? – Akash Sep 23 '15 at 10:07
  • If you have not done so already, (cross)compile `opencv_core` for `ARM`, like described here: http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html. Then change the location where `libopencv_core.so` can be found in your Eclipse project, and try to rebuild it again linking it with the freshly build library. – KompjoeFriek Sep 23 '15 at 21:03
  • I uninstall the opencv to create the freshly build libraries but now my opencv is not installing. Some errors..mentioned here: - [http://stackoverflow.com/questions/32749454/opencv-installation-error-ubuntu-14-04] – Akash Sep 23 '15 at 21:14