News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

paths in Global Variables Editor

Started by unamigo, December 01, 2012, 09:57:43 AM

Previous topic - Next topic

unamigo

I downloaded a big codeblocks project, and when I click on the cdb, I am asked to set the paths for the glew library through the Global Variables Editor. I did such things tens of times by adding search directories in the project's build options, but never with variables before.
On my system (Ubuntu 12.04 + Codeblocks 10.05), glew.h is located in /usr/include/GL/, and its associated lib is in /usr/lib/i386-linux-gnu/
In the Global Variable Editor, there are different fields for the include and lib paths, but my problem comes from the mandatory "base" field. I tried to leave it empty, but it complained, so I tried to fill it with /usr/lib/i386-linux-gnu/ for example. The compiler passed, but the linker complains with:

/usr/bin/ld: fatal error: /usr/lib/i386-linux-gnu/: pread failed: Is a directory

I don't find a reference to that error message anywhere. How should I fill that base directory field, when the include and lib are in completely different locations like in my case? The problem definitly has to do with the base field because if I replace gnu by gnubbb in it, it shows up as such in the error message.

oBFusCATed

The base doesn't matter, but you must make sure that you're not using it anywhere.
In your case you should use $(#myvar.include) and $(#myvar.libs) and the base won't be referenced.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

unamigo

Thanks a lot. Seing your message, I replaced $(#glew.lib), with $(#glew.libs) in the linker settings, and it worked. Why an s?
In the wiki, it says .lib, and that's how the project was setup when I got it.

I am having hopefully a last issue to link this project. There is another library (sim3d) specified in the link libraries field that does not use global variables this time. It just shows up as sim3d on a separate line, no space or weird char on that line, but I am getting :
ld: error  cannot find -l-lsim3d

I even moved that library in /usr/local/lib, to be sure it can be accessed, but it is the -l-l that I cannot explain.   

oBFusCATed

Quote from: unamigo on December 01, 2012, 07:06:54 PM
Why an s?
Just a typo.


Quote from: unamigo on December 01, 2012, 07:06:54 PM
I even moved that library in /usr/local/lib, to be sure it can be accessed, but it is the -l-l that I cannot explain.   
Just inspect you project to see where this option is specified.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]