Comments (12)
(Off-topic): Rather than create a new "issue" so I don't spam up so many topics in so little time, Visual Studio 2013 came up with an issue of not having <endian.h> as referenced in "endianness.h". I noticed that there was a "fixme later" in the comments. Have you seen this alternative public header that you could use? Maybe it could shortcut what you need to implement?
https://gist.github.com/panzi/6856583#file-portable_endian-h
from libtins.
Could you explain what isue did Visual Studio 2013 came up with? The only thing missing should be detecting whether Windows is little or big endian (and according to the header you linked, it would only be big endian on xbox, which is not a current target for the library).
from libtins.
I wonder if I should split this to a separate issue ticket since it's different from the first.
Anyways, VS 2013 came up with an error in endianness.h, line 49. It says
"cannot open include file 'endian.h': no such file or directory."
It seems to skip over the #elif defined (WIN32)
on line 44 and jumps to the #else
statement. Changing "WIN32" to "_WIN32" on line 44 appears to detect the system properly, however it links to another issue in pcap.h (line 40) where it also requires changing "WIN32" to "_WIN32" or else it fails the logic statement.
At this point I don't know if changing that would do more harm than good, given that this creates more errors (security check C4996) that requires workarounds and disabling features.
from libtins.
Sample of the initial issue
Changing WIN32 to _WIN32 shows that the logic passes (notice that the block isn't as faded, showing that this statement is what will be used)
from libtins.
I see, so the issue seems to be the macro that's being used. I never had problems with WIN32, but apparently _WIN32 is the right thing to use.
from libtins.
Changing it within those two files, as I have tested, seems to clear out issues as far I can tell. I can't seem to get QT Creator nor VS2013 to properly link to tins.lib so that I can look into it further but I think you've got an idea of what to look into.
from libtins.
Mkay, I cleaned up my project a little and retried building the project with the changes of WIN32 to _WIN32 in the two header files I've mentioned. I then get this error (no idea if it's an issue with settings on my end or not):
1>------ Build started: Project: SERIAL2, Configuration: Debug Win32 ------
1> main.cpp
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2798): error C4996: 'std::_Equal1': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2783) : see declaration of 'std::_Equal1'
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\tins\ipv6_address.h(140) : see reference to function template instantiation 'bool std::equal<Tins::IPv6Address::const_iterator,Tins::IPv6Address::const_iterator>(_InIt1,_InIt1,_InIt2)' being compiled
1> with
1> [
1> _InIt1=Tins::IPv6Address::const_iterator
1> , _InIt2=Tins::IPv6Address::const_iterator
1> ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
(This is all I have in my main.cpp)
#include <iostream>
#include <tins\tins.h>
using namespace std;
using namespace Tins;
void main(){
cout << "Hello world" << endl;
NetworkInterface iface;
}
from libtins.
It seems like you're using some flag that turns warnings into errors. That should be a warning, not an error. You can disable it using the compiler's suggestion, just define _SCL_SECURE_NO_WARNINGS
.
from libtins.
Got it. Disabling that gives error LNK2038 for the _ITERATOR_DEBUG_LEVEL ("value '0' doesn't match value '2' in main.obj") which appears to be on my end. I'm not familiar with Visual Studio but I can see that from here on out all issues reside outside of the libtins project. Thanks for your help!
Will you be changing WIN32 to _WIN32? If so, I'll keep my eyes peeled for a new commit
from libtins.
Yeah, I'll change that soon, maybe tonight.
The _ITERATOR_DEBUG_LEVEL thing is caused by the library being compiled on Release mode and your code on Debug or viceversa. Just compile both of them on the same mode and you'll be fine.
from libtins.
Gotcha. I noticed that and changed settings accordingly. Does "RelWithDebInfo" work with user code compiled in both Debug and Release?
Nevermind, it does not! Alright, I'll go about fixing my linker errors. Thanks for your help!
from libtins.
I pushed a fix for this. Thanks for the report!
from libtins.
Related Issues (20)
- Consider using modern CMake (>=3.12) with targets
- Unable to compile Libtins for AIX
- how to call the Stream::user_data() to set and get the custom data ? HOT 1
- IPv6Address::to_string() return a local address HOT 1
- Error: live packet capture not supported on this system
- libtins.so.4.5: cannot open shared object file: No such file or directory HOT 1
- libtins 4.4 conan recipe is conan2.0 incompatible HOT 1
- Multicast packet ( specifically fieldbus) is not parsed
- Tagging a new release / fixup release with GCC 13 patch HOT 1
- 'unresolved external symbol' in Visual Studio 2022 HOT 3
- add #496 in the release notes for v4.5
- Send SYN packet failed on Windows 10 HOT 8
- Any passthru example?
- [bug] UDP::matches_response() return 0 when no inner PDU is available
- How to get gateway? HOT 1
- matches_response() implementation for EthernetII / Dot3
- DataTracker::advance_sequence removes too much data
- Seeing "android ifaddr not supported" regardless of Android version HOT 1
- failures with gtest 1.13+ HOT 1
- wrong "enum OptionTypes" definition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libtins.