You are not logged in.

#1 2014-02-12 11:05:47

Winged4Ever
Member
Registered: 2013-11-09
Posts: 35

[SOLVED][Code::Blocks]Installed needed library, now what?

Hi ARCH-ers,
Today I've got IMO quite easy question but which I cannot overcome by myself - I want to start making some OpenGL stuff using GLFW in Code::Blocks enviroment. I've installed glfw package from official ARCH repositiories. But when I choose GLFW Project in Code::Blocks it asks me to point GLFW location. So now my question is : where it is? Where had this package been installed? Or maybe I'm missing some important puzzle in this whole thing.
I've also googled out this page http://wiki.codeblocks.org/index.php?ti … lling_GLFW but this zip file seems to lack in Linux make files.

Last edited by Winged4Ever (2014-02-12 17:17:12)


|| Kernel: 4.0.4-2-ARCH || Architecture: i686 || WM: ratpoison || DE: none ||

“A man goes to knowledge as he goes to war: wide-awake, with fear, with respect, and with absolute assurance. Going to knowledge or going to war in any other manner is a mistake, and whoever makes it might never live to regret it”
---Don Juan

Offline

#2 2014-02-12 12:13:54

Raynman
Member
Registered: 2011-10-22
Posts: 1,246

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

Winged4Ever wrote:

So now my question is : where it is? Where had this package been installed?

https://wiki.archlinux.org/index.php/Pa … _databases

Offline

#3 2014-02-12 12:35:19

progandy
Member
Registered: 2012-05-17
Posts: 3,195

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

The arch linux glfw package installs only the dynamically linked / shared object library in version 3.x. I guess the code::blocks template may still be configured for glfw 2.7, so update that (or if you must, install the old version from AUR)
http://www.glfw.org/docs/3.0/moving.html

Last edited by progandy (2014-02-12 12:40:09)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2014-02-12 12:39:57

Winged4Ever
Member
Registered: 2013-11-09
Posts: 35

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

@Raynman Thanks, 'pacman -Ql <name>' is what I was asking for.
But unfortunately things have now turned out to be more complex than I thought. The way pacman have installed it seems not to be matching Code::Blocks needs - files are scattered all around dirrefent directiores while it need a proper arrangement.

Output of 'pacman -Ql glfw':

glfw /usr/
glfw /usr/include/
glfw /usr/include/GLFW/
glfw /usr/include/GLFW/glfw3.h
glfw /usr/include/GLFW/glfw3native.h
glfw /usr/lib/
glfw /usr/lib/cmake/
glfw /usr/lib/cmake/glfw/
glfw /usr/lib/cmake/glfw/glfwConfig.cmake
glfw /usr/lib/cmake/glfw/glfwConfigVersion.cmake
glfw /usr/lib/cmake/glfw/glfwTargets-noconfig.cmake
glfw /usr/lib/cmake/glfw/glfwTargets.cmake
glfw /usr/lib/libglfw.so
glfw /usr/lib/libglfw.so.3
glfw /usr/lib/libglfw.so.3.0
glfw /usr/lib/pkgconfig/
glfw /usr/lib/pkgconfig/glfw3.pc
glfw /usr/share/
glfw /usr/share/licenses/
glfw /usr/share/licenses/glfw/
glfw /usr/share/licenses/glfw/COPYING

I tried pointing different directions but only /usr/include/GLFW have required glfw3.h file. and nonetheless Code::Blocks shows an error like this:

The path you entered seems valid, but the wizard can't locate the include directory. The wizard cannot continue.

Do anyone know Code::Blocks well enough to point me out a solution?

EDIT:
@progandy Didn't noticed your post. Anyway I'll try the possible solution as you described.

Last edited by Winged4Ever (2014-02-12 12:44:58)


|| Kernel: 4.0.4-2-ARCH || Architecture: i686 || WM: ratpoison || DE: none ||

“A man goes to knowledge as he goes to war: wide-awake, with fear, with respect, and with absolute assurance. Going to knowledge or going to war in any other manner is a mistake, and whoever makes it might never live to regret it”
---Don Juan

Offline

#5 2014-02-12 13:15:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,429
Website

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

If prograndy's suggestion doesn't get what you need you may want to revise your title to include code::blocks, as this issue is specific to that environment.

As an aside, this is one of the reasons I avoid all such IDEs.  They try to do everything for you, but often they do it wrong, and they hide all the steps somewhere so it is hard to fix.

Without an IDE, you could just use `pkg-config --cflags --libs glfw3` on the compiler line or in a Makefile.  I have no idea how this is done in an IDE, but again if you specify the IDE in the title, you'll have better luck getting input from other code::blocks users.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2014-02-12 13:18:44

Neburski
Member
Registered: 2009-09-15
Posts: 118

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

You'll most likely need to change the values for include and lib directories in your project appropriately. I don't know where you have to do this in Code blocks, but the correct values are most likely these:

include directory = /usr/include/GLFW
lib directory = /usr/lib

You might need to try the above with or without trailing '/'.
Double check the values in "/usr/lib/pkgconfig/glfw3.pc". Maybe Code blocks can be even pointed to this pkgconfig file (I don't know though) to find the correct directories by itself.

Offline

#7 2014-02-12 13:18:45

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,404
Website

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

I suspect OP doesn't have pkg-config installed.


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2014-02-12 16:29:09

Winged4Ever
Member
Registered: 2013-11-09
Posts: 35

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

I prefer to use IDE over standard text editors cause I like it's one click Build and Run option + superb easy accesibility to project files.

Anyway I have found a (not fully working yet) workaround - it seems that prograndy was right about partial lack of GLFW3 compatibility in Code::Blocks.
I've created a new empty project and linked everything by myself (libglfw3.a, libX11.so, libXxf86vm.so, libpthread.a, libXrandr.so, libXi.so, libc.a). Then I've pasted a sample GLFW3 project to check if it's working correctly.
Everything seems to be compiling just right, except one thing:

g++ -L/usr/local/include/GLFW -L/home/winged/coding/.tools/fmod/inc -L/home/winged/coding/.tools/ncurses-5.9/ -o bin/Debug/music_visualizations obj/Debug/main.o   /usr/local/lib/libglfw3.a /usr/lib/libGL.so /usr/lib/libX11.so /usr/lib/libXxf86vm.so /usr/lib/libpthread.a /usr/lib/libXrandr.so /usr/lib/libXi.so /usr/lib/libc.a /home/winged/coding/.tools/fmod/lib/libfmodex-4.44.31.so /home/winged/coding/.tools/ncurses-5.9/lib/libncurses_g.a /home/winged/coding/.tools/ncurses-5.9/lib/libncurses.a
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: error: ld returned 1 exit status

I truly don't how should I use -fPie and -pie flags (they are not even on Compiler flags list). Any suggestions?

Last edited by Winged4Ever (2014-02-12 16:50:43)


|| Kernel: 4.0.4-2-ARCH || Architecture: i686 || WM: ratpoison || DE: none ||

“A man goes to knowledge as he goes to war: wide-awake, with fear, with respect, and with absolute assurance. Going to knowledge or going to war in any other manner is a mistake, and whoever makes it might never live to regret it”
---Don Juan

Offline

#9 2014-02-12 17:03:28

Neburski
Member
Registered: 2009-09-15
Posts: 118

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

http://forums.codeblocks.org/index.php?topic=11576.0

Personally I think you should have been able to figure that out by yourself quite easily. You just need to look through the menu's and then fill in the fields for compiler and linker options or at least google how to add additional compiler flags.

Appropriate XKCD.

Offline

#10 2014-02-12 17:16:23

Winged4Ever
Member
Registered: 2013-11-09
Posts: 35

Re: [SOLVED][Code::Blocks]Installed needed library, now what?

Problem solved.
All I had to do was to delete libc.a from links, because out of nowhere it was error-prone in this case...

So summing up, Code::Blocks's GLFW project template is not compatibile with 3.x version so 'Empty project' needs to be created first then all libraries needs to be linked by oneself inside "Build options".

Required libraries:

/usr/libGL.so
/usr/lib/libglfw3.a
/usr/lib/libpthread.a
/usr/lib/libX11.so
/usr/lib/libXi.so
/usr/lib/libXrandr.so
/usr/lib/libXxf86vm.so

And required linker search directory:

/usr/include/GLFW
/usr/include/GL

Last edited by Winged4Ever (2014-02-23 09:32:14)


|| Kernel: 4.0.4-2-ARCH || Architecture: i686 || WM: ratpoison || DE: none ||

“A man goes to knowledge as he goes to war: wide-awake, with fear, with respect, and with absolute assurance. Going to knowledge or going to war in any other manner is a mistake, and whoever makes it might never live to regret it”
---Don Juan

Offline

Board footer

Powered by FluxBB