Add libcurl Unreal Engine 4 - c++

i need to include libcurl in my unreal engine project, i need to use it in game, how i can do it? i have tried standard tutorial for include curl in visual studio, but not work.
the compiler return error on other portion of code if i include curl with following code
#include <curl\curl.h>
I have tried also to change separator to / but nothing, i have read about thirdbart library but how i can add curl?
other questione, look in Visual Studio project, curl.h is included in extetrnal reference for Engine project, but not in Game project.. how i can include?
EDIT
i have included the directory
C:\Lib\curl\builds\libcurl-vc-x64-release-static-ipv6-sspi-winssl\include\
lib direcotry
C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\lib\
when include curl show this error when i compile:
If i remove #include curl\curl.h from code it compile fine.

I have solved!, You must add the path of library in VC++ tab in , includes directory and lib directory, after you must add this line in you build.cs
PublicAdditionalLibraries.Add("path to lib file");
PublicIncludePaths.Add("path to includes directory");
have nice day!

Related

How to reference header files in visual studio 2017 project

I have downloaded and tried to build The oxygine engine project with VS 2017 Community. The stringutils.cpp file from it gives me the following when I try to compile:
C1083: Cannot open include file: 'SDL_stdinc.h': No such file or directory
hovering the #include statement it says cannot open source file 'SDL_stdinc.h'
I checked
Properties->C/C++->General->Additional Include Directories
and it references the path the header files are in. I have even added another path representing the absolute path. I tried a different folder, a different download of the header files, all to no avail.
What do I need to do to get this right?
Is there any reason for a header to not work? (version mismatch or something)
Is a header not working if the corresponding dll or lib is missing?
If so, how do I know it is found by VS?
The problem was the path for oxygine in the oxigine project properties was setup like this ..\..\..\..\SDL\include\ but had to be setup like that ..\..\SDL\include\

How to compile dlib 19.2 in visual studio 2015 without using cmake

I am using Dlib for face landmark detection for my academic project.
When I am running Dlib 19.2 face_landmark_detection_ex.cpp file in Visual Studio 2015 express, I wasn't able to get the results.
The steps followed
Created new project.
Added existing face_landmark_detection_ex.cpp and source.cpp file from dlib\all folder and added same files to project folder
In VC++ directories added this path D:\dlib-19.2\dlib-19.2 as Include Directories.
Downloaded shape_predictor_68_face_landmarks.dat file.
In the command line argument 'shape_predictor_68_face_landmarks.dat download.jpg' here shape_predictor_68_face_landmarks.dat i have added in project folder and download.jpg is my image file .
Added dlib/external folder to project.
Added #define DLIB_JPEG_SUPPORT
Questions: So many errors in file and not able to understand what is happening.
Your project is not inheriting the include directorys. I think you set "D:\dlib-19.2\dlib-19.2" as the only include dir. Errors like "cannot open source file string" are not related to your code, they are related to your project settings.
Also note:
Again, note that you should not add the dlib folder itself to your compiler's include path. Doing so will cause the build to fail because of name collisions (e.g. dlib/string.h with string.h from the standard library). Instead you should add the folder that contains the dlib folder to your include search path and then use include statements of the form #include . This will ensure that everything builds correctly.
Correct your includes. If E:\dlib-1.92.2\dlib is in your include path, then you should use: #include <image_processing/frontal_face_detector.h>
To fix the cin/cout errors, use std::cin, std::cout and std::endl

How to use graphics.h in codeblocks?

I have recently started learning graphics in C++.
I tried #include <graphics.h> in my program in codeblocks but it shows error. Then I downloaded graphics.h header from a site and pasted in the include folder in codeblocks, yet it shows graphics.h:No such file or directory.
Can anyone teach me how to use graphics.h in codeblocks?
First download WinBGIm from http://winbgim.codecutter.org/ Extract it.
Copy graphics.h and winbgim.h files in include folder of your compiler directory
Copy libbgi.a to lib folder of your compiler directory
In code::blocks open Settings >> Compiler and debugger >>linker settings
click Add button in link libraries part and browse and select libbgi.a file
In right part (i.e. other linker options) paste commands
-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
Click OK
For detail information follow this link.
You don't only need the header file, you need the library that goes with it. Anyway, the include folder is not automatically loaded, you must configure your project to do so. Right-click on it : Build options > Search directories > Add. Choose your include folder, keep the path relative.
Edit For further assistance, please give details about the library you're trying to load (which provides a graphics.h file.)
If you want to use Codeblocks and Graphics.h,you can use Codeblocks-EP(I used it when I was learning C in college) then you can try
Codeblocks-EP http://codeblocks.codecutter.org/
In Codeblocks-EP , [File]->[New]->[Project]->[WinBGIm Project]
It has templates for WinBGIm projects installed and all the necessary libraries pre-installed.
OR try this https://stackoverflow.com/a/20321173/5227589
AFAIK, in the epic DOS era there is a header file named graphics.h shipped with Borland Turbo C++ suite. If it is true, then you are out of luck because we're now in Windows era.
Open the file graphics.h using either of Sublime Text Editor or
Notepad++,from the include folder where you have installed
Codeblocks.
Goto line no 302
Delete the line and paste int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX, in that line.
Save the file and start Coding.
It is a tradition to use Turbo C for graphic in C/C++. But it’s also a pain in the neck. We are using Code::Blocks IDE, which will ease out our work.
Steps to run graphics code in CodeBlocks:
Install Code::Blocks
Download the required header files
Include graphics.h and winbgim.h
Include libbgi.a
Add Link Libraries in Linker Setting
include graphics.h and Save code in cpp extension
To test the setting copy paste run following code:
#include <graphics.h>
int main( )
{
initwindow(400, 300, "First Sample");
circle(100, 50, 40);
while (!kbhit( ))
{
delay(200);
}
return 0;
}
Here is a complete setup instruction for Code::Blocks
How to include graphics.h in CodeBlocks?

Include statement: can't find SDL/SDL.h file

My understanding is that when I build a C++ project in xcode and I have an include line in one of my C files in angle-bracket form then the C++ compiler that works with xcode looks in /System/Library/Frameworks/ to find the file. I think that because of this answer: when I use the line #include <OpenGL/gl.h> in my xcode project, where does it look for the gl.h file?
I have an SDL.h file at /System/Library/Frameworks/SDL.framework/headers/SDL.h (I downloaded the folder SDL.framework and copied it to that location with the command sudo cp -r /Volumes/SDL/SDL.framework System/Library/Frameworks)
But my include statement in one of the files in my xcode project still gives this error:
#include <SDL/SDL.h> //throws file not found
Did I properly install the SDL framework? Why doesn't xcode see it?
Under your projects Build Settings, do a search for "search". Add a header search path to the SDL directory /System/Library/Frameworks/SDL.framework/headers
Should be able to just do this after:
#include <SDL.h>
Hope that works for you.
You can also check out this link:
http://meandmark.com/blog/2012/01/using-sdl-with-xcode-4/
It's for Xcode 4, but it looks like all the pieces are there.

unable to link FMOD library to VS2010 project

I am trying to link FMOD to my project, which I did very easily in the past in Visual Studio 2008.... So I have placed the fmodex_vc.lib and the fmodex.dll file in my project directory, added them to my project's solution explorer, then created a SoundMgr.h file which includes the fmod.h file
#include "include\fmod\fmod.h"
Where fmod has been placed in the include\fmod folder and opens ok if i right click on the above code and click "Open Document"...
But if I try to write any code at all, including a simple "using namespace FMOD" it tells me that it FMOD is undeclared or unidentified.... am I missing any step?
EDIT:
What the class looks like so far is:
#pragma once
#include "main.h"
#include "include\fmod\fmod.hpp"
#include "include\fmod\fmod_errors.h"
#include "include\fmod\fmod.h"
class SoundMgr{
void init();
};
void SoundMgr::init(){
FSOUND_Init (44100, 32, 0);
}
And the error is:
Error 1 error C3861: 'FSOUND_Init': identifier not found
And that's for any line of the sample code that I try import from this quick guide:
GameDev FMOD quick guide
I tried adding the library as an additional dependency in the Input section of the Properties/Linker and I get
1. fatal error LNK1181: cannot open input file 'fmodex_vc.lib'
Any of these errors ring a bell?
Don't you want fmod.hpp to get the c++ features?
you can include the headers path in C/C++ > General and library path to Linker properties and include the dll's in you project. In this case you have the files in you release/debug dir
Right so I eventually fixed it by removing the Additional Dependency in the Input section of the Linker and instead adding Include and Library directories in in Configuration Properties\VC++ directories.... Most articles I found advise to use the actual full path to the FMOD installation folder, but since I want this project to be portable and self contained, i created a "lib" and "include" folder in my project and put those files in them... (used the directories "\lib" and "\include" in the project properties which I am assuming links to the project folder, have never done this before but am hoping it won't cause dependency issues if I compile this on a different machine)...