Curious about something
Bob Keane

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.

Gideon Weems

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.


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
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

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

Thread #616929. Printed from