CODE::BLOCKS IDE help - configuration

Hi, I statted to use code::blocks IDE but I cannot find out what I do wrong
that compiler cannot find a library. System Windows XP, CODE::BLOCKS 13.12
installed gcc (tdm-1) 4.7.1 as part of the program. I use AMD Stream library for OpenCL, which automatically installs library to directory "C:\Program Files\AMD APP". Adding linking and searching folders in project settings. I orginally tried adding quotes around the paths or around segments having space and long names but this failed obviously because the compiler see filenames in 8.3 file format. So I adopted the paths so:
C:\PROGRA~1\AMDAPP~1\lib\x86\OpenCL.lib
W:\___NEW~1\GAUSSI~1\GAUSSI~2\refu.dll
OpenCL Compiler in
C:\PROGRA~1\AMDAPP~1\include
Linker in
C:\PROGRA~1\AMDAPP~1\lib\x86\

Now I got the errors:
1
2
3
4
5
mingw32-g++.exe -LC:\PROGRA~1\AMDAPP~1\lib\x86\ -o bin\Debug\Gaussian_with_OpenCL.exe obj\Debug\main.o  -lOpenCL  "C:\Program Files\AMD APP\lib\x86\OpenCL.lib" -lrefu.dll C:\PROGRA~1\AMDAPP~1\lib\x86\OpenCL.lib W:\___NEW~1\GAUSSI~1\GAUSSI~2\refu.dll
p:/programy/programování/codeblocks_32bit/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lrefu.dll
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))


And I cannot find out why there are the long names in
-lOpenCL "C:\Program Files\AMD APP\lib\x86\OpenCL.lib"
instead of 8.3 format.

Any help appreciated
Last edited on
Don't worry about the file name format and feel free to ignore the crap like this that is spewing out of stack overflow these days. In Windows every data file and directory entry has two attributes that are both automatically created with the file and representative of its name. They are called the 'CSName' and the 'EightDotThreeFileName' both of which are accessible, and translatable by any application running on Windows. There is no way that the teams that are currently supporting MingW or Code::Blocks are oblivious of this knowledge.

When you link to a library that is designed for MingW it will generally be in the format "lib<NAME>.a". Files like "<NAME>.lib" are usually meant for cl. In Code::Blocks, under Project -> Build Options -> Linker Settings: Delete the entries you entered by hand, then use the Add button and navigate to them to make sure they exist. Also make sure you link to the correct versions.

OK, I renamed the configuration to use libOpenCL.a but I cannot find refu.a, I have only refu.dll. So you basicly say, that CODE::BLOCKs will not work with libraries *.lib? So do I must to compile the refu library sources in CODE:BLOCKS to get the .a? But I have seen tutorial how the author used the refu.dll in CODE::BLOCK and you can see he did not used any *.a file:
http://blog.refu.co/?p=663
Originally, I did as what he showed in the images, but the way did not work to me using ATI.

Actual error is:
1
2
3
4
mingw32-g++.exe -Wall -fexceptions -g -I"W:\___NEW PROJECTS\GaussianBlur\OPENCL tests\opencl\cl" -I"C:\Program Files\AMD APP\include" -c W:\___NEW_PROJECTS\GaussianBlur\Gaussian_with_OpenCL\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -L"C:\Program Files\AMD APP\lib\x86" -o bin\Debug\Gaussian_with_OpenCL.exe obj\Debug\main.o  -lOpenCL  "C:\Program Files\AMD APP\lib\x86\OpenCL.lib" -lrefu.dll "C:\Program Files\AMD APP\lib\x86\libOpenCL.a" W:\___NEW_PROJECTS\GaussianBlur\Gaussian_with_OpenCL\refu.dll
p:/programy/programování/codeblocks_32bit/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lrefu.dll
collect2.exe: error: ld returned 1 exit status
Last edited on
OK, I renamed the configuration to use libOpenCL.a

Undo that. You have to either go out and find a version of this library compiled for GCC\MingW or you need to grab the source and try to compile it yourself. Renaming a file does not change it's internal linkage, naming conventions and a half dozen other things that would be needed for this to work.
Why this CL file? This does not complain to make problems. It complains about "refu.dll". I have refu sources downloaded from here https://github.com/LefterisJP/Refu, but I don't have sources of AMD SDK Stream. AMD offers three files in x86 folder: OpenCL.lib, OVDecode.lib and libOpenCL.a . If I need to recomile the refu library, then I am lost. I does not contain any project file or makefile. I don't see any information for the refu project.
Let's start over. What tutorial are you using?
I sent the link already. This tutorial
http://blog.refu.co/?p=663
It is strange that there are no mention about any other problems. I'd me glad if it were so simple as it is in the tutorial.
Topic archived. No new replies allowed.