I am trying to link Curl to my CodeBlocks C project for at least 6 hours unsuccessfully. I googled and followed many instructions but nothing seems to work.
I have downloaded curl-7.54.1 as a .zip file, copied the curl.exe to C:/Windows/System32 and added it to Path. I can call curl from the command prompt successfully but I cannot figure out how to link the library to my project.
I tried copying the curl folder to my project folder, I tried linking the libraries from the Compiler Settings in CodeBlocks, I tried various combinations of Linker libraries, Other linker settings, etc... and NOTHING works.
I need some help to figure out how to successfully link this project, simple concise steps will be greatly appreciated!
Related
I am using Codeblocks in Windows 10. Earlier I used to compile only 1 file, so I would just press the 'Build' and 'Run' button on codeblocks.
But, this time there are separate files I need to compile separately (to .o format) and then link to form a single executable file which I need to run. How can I do this in CODEBLOCKS? (In UNIX/LINUX systems, I know this is the 'make' command; but I don't know how to do it here?)
Can anyone help me? I tried reading some help pages on CodeBlocks on the internet, but they were so complicated, I gave up.
make isn't a compiler, and neither is CodeBlocks. make is just a command that runs other commands from a Makefile. The actual command that gets run is something along the lines of gcc a.cpp b.cpp, and it's the same command (or similar enough) that gets run when you build inside CodeBlocks. CodeBlocks should automatically build and link all of the source files that you add to your project. If you aren't seeing this happening, make sure you add them to the project inside of CodeBlocks and don't just put the files in the directory.
Recently I started coding in C and I tried to find a way to compile with notepad++. After thouroughly installing minGW with some basic upgrades I tried to use a specific code that allows me to compile.
This code is can be found on thise webpage:
http://www.thecrazyprogrammer.com/2015/08/configure-notepad-to-run-c-cpp-and-java-programs.html
So you can see what I am trying to do.
However when I try to execute the command, it gives me the warning that several .dll files are missing.
These are the ones: libgmp-10.dll ; libiconv-2.dll ; libmpc-3.dll and libmpfr-4.dll
After some research, I added those files to the bin, lib and libexec folders of the minGW headfolder and it resulted in giving me another missing lib file:
libgcc_s_dw2-1.dll
Ok I added that one too and now it starts over saying it is missing libiconv-2.dll
I added all the folders to my PATH and there is nothing else I can think of that is wrong =(
If u find a solution, please explain it in detail since I am not a programmer and only have little experience with going this 'deep' into files and paths etc ...
Thanks in advance!
Oh I found it myself I think.
I read somewhere that using gcc in stead of g++ could help and after copying the missing files to a bunch of folders it worked :D
I have downloaded Curl and would like to add libcurl only (no other stuffs) to my CodeLite Workspace. I have seen VC Project files but I do not use VC (and I use Primarily Ubuntu).
So I need help to know which files to Include and any pre-processor that I need to include for the library to compile.
I have tried adding all *.c/*.h files but I keep getting errors (if those errors can be of help I will post them). Add the include folder in curl root directory does not help either.
Thanks
I ended up with compiling library with terminal and just tell CL to find it there!
I get the error
cannot find -lpthreadGC2
when building my program. The strange thing is that it is definitly there. I build using cmake, in combinition with Eclipse and MingW. All other libraries work perfectly fine (they are set up in the same way).
With cmake I can use the command message() to give out messages. I checked that all include paths and lib pathes are set correctly with message(). I can confirm this in the Eclipse project settings, the paths are set (including pthreads.h works perfectly, it is found).
The command target_link_libraries(MyApp "libpthreadGC2.a") is also executed (checked again with message()).
Summary: all pathes are set, all linking is ordered to cmake. Eclipse knows all the paths. But the MingW linker doesn't find the library. Any ideas where I should look for the errors?
Ah, just found it out...
The cmake command add_executable() has to come after the link_directories() call... But I still wonder, why this only was for the pthreads lib and not for the others...
I know it can sound as a pretty dumb question, but I do not have a great experience with installing downloaded libraries...
Anyhow I downloaded the source code of JudyArrays (which is a C library for a 256-trie for those who doesn't know it) from sourceforge and the installation instructions refers to the make command. I tried to download this utility, but I can't get it work. Which is the correct target makefile? All I managed to get was:
"..path\Makefile.in":15: *** missing separator. Stop.
I tried googling for some help but didn't find anything, either I'm searching with the wrong query string or I'm the only dumb person in the whole planet that can't manage to install it...
Any help? Is there any simpler method?
Thanks everyone
Run your Visual Studio Command Prompt to get a cmd.exe with the proper paths set. cd into the src directory of the JudyArrays source code and run build.bat. This'll compile Judy and produce a .lib and a .dll and a Judy.h header file file you'll have to use in your projects as any other 3. party library.