Using libtorrent with MSVS 2013 - visual-studio-2013

I installed libtorrent (version 1.0.2) with the NuGet package manager in MSVS 2013. When I run this to see if I can use it:
#include <libtorrent\session.hpp>
using libtorrent::session;
int main()
{
// session ses;
return 0;
}
I get the error error C1021: invalid preprocessor command 'warning'.
This takes me to project_source\packages\libtorrent-src.1.0.2\lib\native\libtorrent\include\libtorrent\config.hpp to a line:
#warning unknown OS, assuming BSD
I'm not sure what that's about, I tried changing it to #error as per a post on cplusplus.com, but the same error came up. Probably foolishly, I commented that line out to see what happens, and now it's taking me to project_source\packages\libtorrent-src.1.0.2\lib\native\libtorrent\include\libtorrent\file.hpp saying that
error C1083: Cannot open include file: 'unistd.h': No such file or directory
Any ideas how to fix this? I tried not using NuGet, but I couldn't figure out how to use libtorrent from downloading source. The website wasn't much help to me.

looking in config.hpp, the assumption is that the WIN32 macro is defined on windows. In your case, that appears to not be the case.
Perhaps you could try to change it to test for _WIN32 instead.

Related

How to access header files after installing with vcpkg?

I'm trying to use ICU in a project in Visual Studio, which I am new to. The VS documentation encouraged me to use vcpkg, so I downloaded it. I then installed icu through vcpkg. I integrated vcpkg for my userspace.
I'm now able to include icu, but some classes aren't found. In this case I want to include normalizer2.h but none of the syntax I try works. How can I include the individual header files within the icu package?
A snippet to demonstrate:
UErrorCode uErr=U_ZERO_ERROR;
const icu:: Normalizer2* UNormalizer = Normalizer2::getNFKCCasefoldInstance(uErr);
Throws the following error:
error C2039: 'Normalizer2': is not a member of 'icu'
#include <unicode/normalizer2.h> should work if vcpkg is correctly set up. At least the file is installed into <vcpkgroot>/installed/<triplet>/include/unicode/normalizer2.h.
Make sure <vcpkgroot>/installed/<triplet>/include/ is in your include paths (which it should if the integration is installed).
You might add /showIncludes as a compiler flag to see which include directories are searched.

cobc: Invalid argument error when compiling

I'm currently taking up a course in COBOL and recently I have only been using an online compiler. When I decided to install the OpenCOBOL IDE. I keep getting the error "cobc: Invalid argument" whenever i try to compile. I tried multiple re-installs still to no avail. I also tried installing just the compiler itself and compiling my files using cmd, but still it gives that error. Any help? I really need to get it working.
OS: Windows 8.1 64-bit
You need an "-x" option to tell the compiler build an executable with the same name as the program source (but without the .cbl or a "-o progname" option to tell the compile to produce an executable named progname.

Compilation error in Xcode, subliminal.h not found

After following the steps to install Subliminal via git submodule, I receive an error when trying to compile that says:
Lexical or Preprocessor Issue 'Subliminal/Subliminal.h file not found
This issue occurs in the app delegate file, after I add in #import . If I use Command + Click the header, I am lead to the header file. However, during compile, Xcode gives the above error.
*Edit: It's not libSubliminal, but I still can't figure out what goes wrong
*Import code is #import <Subliminal/Subliminal.h>
After a nice adventure with StackOverflow, I found this solution:
Xcode 4 can't locate public header files from static library dependency
So far it has worked for me (I have managed to compile and run a default test).

OpenCV QT VS2010 link error

As the title implies, I am using VS2010 with OpenCV 2.4.3 and QT 4.8. I tried running them independently (OpenCV+VS2010) and then (Qt+VS2010) and they worked fine. But when I try to run all three of them together in a single program, I get a linker error
1>LINK : fatal error LNK1104: cannot open file 'opencv_calib3d244d.lib'
I tried looking around but doesn't seem to be able to find any solution. Could you please advice? Thank you.

Xinput.h: No such file or directory

I'm trying to get input from an xbox controller, I went to this page:
http://www.codeproject.com/Articles/26949/Xbox-360-Controller-Input-in-C-with-XInput
and I'm just test running his source, good thing I did because it found an error:
C:\Users\me;)\Desktop\XBOX360Test\XBOX360Test\CXBOXController.h|9|fatal error: Xinput.h: No such file or directory|
Can I don't know what the issue is, doesn't Xinput ship with windows?
I'm late I know, but I get the same error.
Opening the project in Visual Studio works fine, but compiling with gcc doesn't. Seems like the compiler of VS knows more than gcc and you need to compile it with that one. Here's how:
http://msdn.microsoft.com/en-us/library/ms235639(v=vs.80).aspx

Resources