I am trying to compile an OpenCL project under Eclipse using Cygwin Gcc/G++ compiler and i got some Undefined References for OpenCL API functions. I saw many threads about this problem, I tried the suggested solutions but I still have these errors.
Basically my code just retrieves OpenCL infos about the platform and device I use so I dont give it here but I can if you want (even if I dont think it is very interesting).
Here is my makefile :
RM := rm -rf
OpenCLEnvInfos.o: ../OpenCLEnvInfos.cpp
g++ -IINCLUDE_DIR1 -IINCLUDE_DIR2 -g3 -Wall -c ../OpenCLEnvInfos.cpp -o OpenCLEnvInfos.o
@echo ' '
OpenCL_infos.o: ../OpenCL_infos.cpp
g++ -IINCLUDE_DIR1 -IINCLUDE_DIR2 -g3 -Wall -c ../OpenCL_infos.cpp -o OpenCL_infos.o
@echo ' '
# All Target
all: OpenCLEnvInfos.exe
# Tool invocations
OpenCLEnvInfos.exe: OpenCLEnvInfos.o OpenCL_infos.o
g++ -o OpenCLEnvInfos.exe OpenCLEnvInfos.o OpenCL_infos.o -LOpenCL -LGAL-fb
@echo ' '
# Other Targets
clean:
-$(RM) OpenCLEnvInfos.o OpenCL_infos.o OpenCLEnvInfos.d OpenCL_infos.d OpenCLEnvInfos.exe
@echo ' '
I tried everything (Libs order in linking command), -l instead of -L (but the compiler doesnt find them) ... Eclipse makefile generation make more errors occurs that's why I had to rewrite it...
I hope someone has the answer :p
Baptiste