Libxml2 for c++ project configuration issue windows - c++

I am using eclipse Version: Luna Release (4.4.0), MingW 32 bit compiler, window 64 bits along with libxml2-2.7.8.win32. I successfully compiled and build the project with no error but while i tried to run there is no output nor any error message.
I have specified path of 'lib' folder of libxml2 in eclipse as project-> Properties -> c/c++ build -> setting -> toolsetting -> mingW c++ linker -> libraries (-l) and Library search path (-L). In library i have used full name "libxml2" and search path i have placed "${workspace_loc:/${ProjName}/libxml2-2.7.8.win32/lib}"
there is a dll file "libxml2.dll" in the bin folder and have doubt whether i should place it some where or set reference path somewhere.
or should i use any c++ wrapper to execute the libxml2

Related

Eclipse CDT, Why does Eclipse prepends 'lib' to the name of a shared library?

I am using Eclipse Eclipse 2022-09 with CDT 10.7.1202208222120 on Fedora 37.
I am working on a simple C++ testapplication (libTest.cpp) which should use code from 2 shared librarys (libBasexCpp and libBasexSocket).
All 3 sources compile without errors and building libTest also completes without error. In the Properties -> Settings -> Build Artifact dialog for libBasexCpp and libBasexSocket, I have chosen not to use a Output Prefix (prefix is ""). In the debug directorys, libBasexCpp.so and libBasexSocket.so are created.
When I try to run the testapplication as a local C/C++ application, I first have to choose which local application should be run , liblibTest or libTest.
Executing either one of the 2 results in a message, saying that liblibBasexCpp can not be found.
I have added Library Paths (DYLD_LIBRARY_PATH = ${workspace_loc:/libBasexCpp/Debug};${workspace_loc:/libBasexSocket/Debug} as Environmentvariable to the run configuration.
How can I configure Eclipse in such way that it loads the shared library's?
Basically, to configure the shared librarys and the test application, I followed the instructions as I found on Shared libraries with Eclipse CDT and cygwin on Windows.
What was missing therein was the instruction to add in the Run configuration the variable LD_LIBRARY_PATH containing the paths to both libraries.
After adding this variable, the test application worked.

Specify external library for linux from Visual Studio 2017

I'm developing linux(ubuntu) c++ project from Visual Studio 2017. I want to integrate googletest into my code. I have installed googletest and run test example according following tutorial. Everything works fine when I run it from bash terminal using cmake.
Now I need to run it using VS. For that I need to specify path to /usr/lib/libgtest.a from VS. I added /usr/lib into Linker->General->Additional Library Directories and added libgtest.a into Linker->Input->Additional Dependencies. But compiler still cannot link the library:
g++: error: libgtest.a: No such file or directory
Try omit "lib" and ".a" from the file name as these portions of the filename seem to be added by the linker itself. In your case you would reference "gtest".
Try Configuration Properties -> Linker->Input->Library Dependencies with "gtest". Note: libgtest.a must in standard location so linker can search.

Cross-compiling ALSA-lib for Raspberry PI on eclipse windows PC

I want to cross-compile alsa-lib for raspberry pi using eclipse on windows pc. I am using Sysgcc toolchain for windows used for cross-compiling on Raspberry PI.
I downloaded the alsa-lib library package from
"https://www.alsa-project.org/main/index.php/Download"
and copied it to my 'src' folder. I also added paths to this library as follows.
1) "Project-> Properties-> C/C++ Build-> Settings-> Cross GCC Compiler -> Includes"
and added the library path "C:\Users..\workspace\wavfileplay\src\alsa-lib-1.1.4.1"
2) "Project-> Properties-> C/C++ Build-> Settings-> Cross G++ Compiler -> Includes"
and added the library path "C:\Users..\workspace\wavfileplay\src\alsa-lib-1.1.4.1"
3) "Project-> Properties-> C/C++ Build-> Settings-> Cross G++ Linker -> Libraries"
and added "asound" in Libraries(-l) and gave the library search path for 'libasound.so' as "C:\Users..\workspace\wavfileplay\src".
But I am unable to compile the code. I removed several errors like not finding the header files by giving it the right path in different files. But now I am facing another error
expected ')' before '__SYMBOL_PREFIX' local.h
I didn't change the local.h file as it is part of the alsa-lib library. I alsa checked the brackets and they are fine.
First, is it possible to cross-compile alsa-lib for Raspberry PI on Windows using Eclipse?
If yes, then any ideas on how to remove this error?
Thanks alot

Where do I assign SDL 2.0.3 directories in NetBeans 8.0?

I don't know where to put the libraries nor which libraries are 64 bit or 32 bit. And it is becoming a pain spending most of my weekends trying to get a dynamic library to work. I'm using Windows 64 bit system but my program is 32 bit. Also I'm using C++. Can someone create a step by step guide.
If you develop a 32 bit program, you should use a 32 Bit SDL library.
You can place your libraries (and their headers) everywhere - but if you are using MinGW better keep blanks out of the path. Just tell the compiler where he can find those files.
And here's how to do this in NB:
First, go to Right click Project --> Properties
C++ Compiler: at Include Directories set the path where the headers of your libs are
Linker:
at Additional Library Directories add the path where your lib binaries are
at Libraries add the name (!) of your library - without prefix lib or file extension
If your Libraries are named eg. libSDL2.dll set SDL2 as name; if SDL2.dll only SDL2.

Adding POCO C++ Library Netbeans on Linux

I am trying to use POCO C++ Library with Netbeans IDE on Ubuntu Linux 13.04. I have downloaded, build and installed the POCO C++ Library. The library can be found in the directory "/usr/local/include/Poco". I would like to know how to add the POCO C++ Library to the Netbeans IDE and be able to work with it. Please answer with details.
Thank You
To link an external libraries you need in general three things:
To add the header files as an include directory -I flag
To add the library path to your POCO C++ *.so files -L flag
To add the library name to your compiler without the lib prefix, for example with poco would be poco-Foundation and the name of your file in your system would be libpoco-Foundation.so
Now for Netbeans specific
For the header files
File -> Project Properties -> Build -> C++ Compiler -> General -> Include Directories which is step one
For the library directories
Project -> properties -> Linker -> Additional Library Directories which is step two
For the library
Project -> properties -> Linker ->Libraries -> Add option -> Other is only for the library file, which is step three.
In the case of the Poco Libraries they are usually handled like the Boost Libraries, for example
#include "Poco/AutoPtr.h"
This means the Include Directory has to be one level up from the Poco folder. For example if your Poco folder is on "/usr/local/include/Poco" then you need to add the "/usr/local/include" to your Include Directories (from step one).
As for the -L/usr/local/include/Poco This is not how it is done. This path is the path to your specific library, in the case of poco there is Foundation, XML, Net, and Util along with the test projects. You need to find the files that are named libPoco-*.so where "*" means something. This is most likely in your the directory usr/local/lib if those files are not there then they are most likely in usr/local/lib/Poco
If there are no files named libPoco-*.so you have to build your Poco libraries separately.