Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Curious about something

This thread is locked; no one can reply to it. rss feed Print
Curious about something
Bob Keane
Member #7,342
June 2006

I had a problem compiling and linking enet and was able to solve it. The problem was the PKG_CONFIG_PATH was not finding the elibnet.pc file. Research suggested copying the file to /usr/lib/pkgconfig. I did that and ran ldconfig but I still could not compile. Finally, I used EXPORT to add the pkgconfig folder to the search path and it compiles and links properly. I was just wondering why using EXPORT works but not the other way. Any ideas? I'm using Fedora 25.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
If we get apple juice from squeezing apples, and we get prunes from drying out plums, where does prune juice come from?
Hi Randall Monroe.

Gideon Weems
Member #3,925
October 2003

Is /usr/lib in $PATH, for starters?

Secondly, did you actually use "pkgconfig" instead of "pkg-config"?

Bob Keane said:

Research suggested copying the file to /usr/lib/pkgconfig.

bamccaig
Member #7,536
July 2006
avatar

Could you elaborate on what you mean by you used "EXPORT"? :-/ I am not sure what you mean. If the file existed in /usr/lib/pkgconfig then you shouldn't have had to edit any search paths. If the file existed elsewhere and you added it to PKG_CONFIG_PATH then it makes me think you mean the built-in shell 'export' command.

In most Unix shells, there are [at least] two kinds of variable: regular variables and environment variables. Environment variables are part of the system process and copied to child processes automatically. Regular variables are only known to the shell. The export command is used to promote a regular variable to an environment variable. If this is the case, if you don't export the variable [and it's not already an environment variable], when you launch a child process like make or cmake the value is not copied and it reverts to nothing from within those processes.

If that doesn't help then please elaborate on what you mean...

Gideon Weems
Member #3,925
October 2003

bamccaig said:

The export command is used to promote a regular variable to an environment variable.

That is a good way of explaining it.

Bob Keane
Member #7,342
June 2006

The problem is solved, so it is not an issue. I'm just not sure why the environmental variable won't stick.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
If we get apple juice from squeezing apples, and we get prunes from drying out plums, where does prune juice come from?
Hi Randall Monroe.

Go to: