Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-added support for pkg-config. #45

Merged
merged 1 commit into from
Nov 20, 2014
Merged

Re-added support for pkg-config. #45

merged 1 commit into from
Nov 20, 2014

Conversation

carlos-jenkins
Copy link
Contributor

This should fix issue #44

For your consideration.

mfontanini added a commit that referenced this pull request Nov 20, 2014
Re-added support for pkg-config.
@mfontanini mfontanini merged commit bcd8cc5 into mfontanini:master Nov 20, 2014
@mfontanini
Copy link
Owner

Thanks for this. One question: the Cflags attribute you set is:

Cflags: -I${includedir}/tins

Shouldn't this be just -I${includedir}? I expect projects to be able to include the path "tins/tins.h" rather than "tins.h".

@carlos-jenkins
Copy link
Contributor Author

Cflags: -I${includedir}/tins

Was the way it was in old autotools file. I compiled the arpmonitor.cpp example using both:

g++ --std=c++11 -I/usr/local/include arpmonitor.cpp `pkg-config --libs libtins` -o arpmonitor
g++ --std=c++11 `pkg-config --cflags libtins` arpmonitor.cpp -o arpmonitor `pkg-config --libs libtins`

arpmonitor.cpp uses #include "tins/tins.h"

 sudo LD_LIBRARY_PATH=/usr/local/lib ./arpmonitor eth0

And both seems to work fine. Nevertheless, I not sure why. I assume because /usr/local/include is maybe included by default? [*]

When I changed in arpmonitor.cpp to use #include "tins.h" (which is not recommended) the following happened:

This failed:

g++ --std=c++11 -I/usr/local/include arpmonitor.cpp `pkg-config --libs libtins` -o arpmonitor
arpmonitor.cpp:30:18: fatal error: tins.h: No such file or directory
 #include <tins.h>
                  ^
compilation terminated.

But this succeeded:

g++ --std=c++11 `pkg-config --cflags libtins` arpmonitor.cpp -o arpmonitor `pkg-config --libs libtins`

At this point I think is up to you if you want to enforce the use of the namespaced include (which I think is a good idea) or not.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants