C++ Adding libcurl (using Curl)? - My attempts explained - c++

Okay, so I know this sounds like a very nooby question but I did my best so please hear me out before adding negative comments/downvoting.
Okay, so from what my research says, using "cURL" for my C++ program when involving anything web-related is the best way to go. Now, me being new to C++, I didnt want to ask questions for every step and try doing it myself, apparently, this was not the case.
Problem: CodeBlocks is not recognizing the curl plugin (saying it does not exist)
Goal:
Attempt to make the example source located here (from the official cURL website) work.
Attempt 1:
So, I downloaded the plugin using the "help manager" where it shows which is the best thing to download. I got the .zip file "curl-7.24.0-devel-mingw32" back. I decided to copy the contents of the "bin" folder to my projects bin and copy the "include" folder to my project. It kept saying it did not recognize "/curl/curl.h" or saying it did not exist.
Attempt 2:
Without deleting the "bin" and "include" folder, i decided to move the "curl.h" folder into my project itself (via CodeBlocks) by creating a folder called "curl" and then putting the "curl.h" inside the folder (The folder "curl" was in the "Headers" folder created by the program) and attempt to run it again seeing that it existed. Same Error
Attempt 3:
After countless searches, I come across that I should put my curl files and all the files inside the "bin" folder into C:\Windows\ folder. So I copied everything in the "includes" folder and the contents of the bin folder (including the "curl" folder in it) to the WINDOWS folder. Same error.
Attempt 4: - Sort of...
Now, there was something about going to my project options and selecting certain files to import and that stuff but it was way more confusing because each site had different options so im unable to do recall the steps.
Im now relying on the StackOverFlow community to give me a hand. I tried explaining my problem in the most detailed way but if you have any questions or need more information, dont hesitate to ask. Also, here is the errors im getting:
http://pastebin.com/raw.php?i=B1wsqvmA
Here is my source:
http://pastebin.com/raw.php?i=YShFZf8G
Can someone please guide me through this mess? Thank you so much!

the problem is that you're not telling codeblocks where to search for the include files, you shouldn't be copying the headers to the project's folder.
You can select the include directories this way:
In Project -> Build Options -> Search Directories -> Compiler
There is a button to add include directories, in this case the "include" folder of libcURL, And that error should be gone.
You will have to follow a similar process to add the files for the linker.

Related

C++ zlibstatic library in VS2019

I'm in the process of learning C++ and I'm halfway through one of my courses so I figured I would try to do something to challenge myself and I'm getting stuck on what I'm trying to do. Long story short I'm trying to parse some info from a file inside of a zip folder.
I followed this post here to understand what to do but I'm missing something that is not quite ovvious to me: How to use zlib library in visual studio 2017?
I'm using VS2019
I researched the libzip and zlib libraries online and realized that I need to get the zlibstatic.lib into my project. I've read through the above posts and I thought I set my paths and folders correctly, but I'm getting an error not being able to source the file.
enter image description here
enter image description here
Thanks for any advice in advance! I hope everyone is staying safe!
Cheers!
MattG
Well you can see that there is no file called zlib.h in the directory you specified. I don't know zlib but usually the header files are in a searate directory. Often it's called include something or other.
Bottom line, in the 'Additional Include Directories' setting you need to specify the folder containing zlib.h, not zlibstatic.lib.
I'm guessing you will also need to add zlibstatic.lib to the Linker/Input/Additional Dependencies setting. It's not enough just to specify the directory where the library is, you have to name it as well.

Eclipse - Can't edit cpp files in my eclipse - folder is not accessible

i want to edit cpp files in Eclipse but can't open the folder that contains the cpp files.
The folder symbol is a folder with an exclamation mark at the bottom right. I tried to look up the meaning of the symbol in the eclipse docs but didnt find something. Maybe a bit more background: the cpp files belong to a cocos2d-x application, eclipse cdt is installed. The files are normally accessible with notepad++ or any other texteditor but eclipse just doesn't list them. Refresh, clean or restart didnt help either. Maybe you guys can help me out.
The esclamation Mark deals with build path problem. This problem are usually related with eclipse metadata, probably rebuilding the Index Will fix it, but the easiest thing is delete the project (without deleting from disk) and import the project using import existing project into workspace. Male a backup before any operation.
Found the problem, a little fault in the path, edited the folder properties now everything works!

Opencv - Can't find header files

I'm trying to start development with opencv. The problem is, until now I coul barely setup the opencv cos I cant find its header files.
I made some research regarding to this subject but none of them were realy helpful, below some of the links:
Where are the opencv2 include files?
http://answers.opencv.org/question/14712/opencvhpp-not-in-opencv2/
I made the built the files using CMAKE GUI - Built the code with MVS 11 x64 both debug and release. The compilation suceeded and I cant found libs and dlls, but no headers at all anywhere.
Checkout the pics:
Opencv2 folder
Local folder
So, now I ask, What am I missing here?
Thanks for the help
EDIT ONE:
Is that what you meant?
EDIT TWO:
I found some headers inside the source of opencv, and each of them is inside an specific folder, like core, highgui and so on - that is it? or something still wrong? cos I thought I should take the headers on the build, no on the source..
append "opencv/build/include" to your include path.
if you built the opencv libraries yourself using cmake, make sure you run the INSTALL project, and add the folder, where it installed to.
When you run make install then the include files that you need are copied to a single directory determined by the makefiles and probably displayed as a part of the output.
I know what's going on. After built the entire solution, under the "opencv" solution strcutre, there is a folder called "CMakeTargets", expand this folder, you can see "INSTALL" project, and right-click this project, then select "build" option, then after installation, all libraries and head files will be located at the correct path. Like the following picture shows:
here
Take a look at the settings that were in use when you built OpenCV - the include path must point to where the include files are for your build to have succeeded.

cannot locate the .lib file VS12 is trying to open

So I am creating an app in VS2012 in MFC using an old Microsoft SDK (called VisSDK for machine vision) which worked fine with VS6. The problem is, I get this LNK1104 error, Cannot open file VisImSrcLibDB.lib.
I have done a search through the project for VisImSrcLibDB...but nothing came up. I have checked all the header files (external) and tried to see where is this being called.
I can presume (based on the name) that it seems to be part of the SDK, but cannot for the love of god figure out where is this being called from.
Any Help would be appreciated in this. Here is a screenshot:
PS: yes I have mapped the lib folder of the SDK under LINKER properties. and the corresponding include folder in the Additional Include directory.
If you haven't already, you should turn on the VS flags for verbose output. That should give some indication as to why things are being pulled into the build.
The VisImSrcLibDB.lib must exist some where in your VisSDK directory.
Use the PROJECT-Properties command, All configurations from the Configuration drop down list and add the directory containing the VisImSrcLibDB.lib file to the Library Directories in the VC++ Directories section.

Trying to figure out Xcode directory system

I'm a bit stuck trying to get box2D to compile and I think it's because I don't quite understand how Xcode handles its build directories.
Box2D is folder containing a set of header and source files (in various subdirectories, etc). I've added the Box2D folder to a coco touch static library project in Xcode and when I try to compile I get errors about header files not being found such as <Box2D/Common/b2BlockAllocator.h>.
I found that if I simply include the header with #include "b2BlockAllocator.h" it compiles fine and Xcode actually finds the file.
So I'm a bit stuck here, I'm assuming I need to find a way to get all includes to begin searching from the root project directory and not from the source files location but I'm not sure how I can do that in Xcode...
Any ideas?
<Box2D/Common/b2BlockAllocator.h> should be found in a directory called Box2D/Common. You said that Box2D contains a set of header and source files. Are some of these headers in a subdirectory of Box2D called Common, or are they all directly under Box2D? If it's the latter, then that's your problem.
OK I figured it out!
In the targets settings page look for 'header search paths' and add the root build directory of your project to it.