VS2019 linux cannot find additional dependencies - c++

I am doing a remote C++ build from VS2019 to a machine with Centos. When I input the library to the option additional dependencies, the vs2019 always shows g++ : error : libTest.a: No such file or directory , the file libTest.a is a library I wrote to test my solution.

You should properly configure you VSLinux environment.
First, add additional include directory on Properties -> C/C++ -> General -> Additional include directory. Add paths of directories for additional header files for your library.
Second, add additional library directory on Properties -> Linker -> General -> Additional library directory. Add directories where your static/shared libraries are.
Third, put your name of libraries on Properties -> Linker -> Input -> Library dependency. Add the name of your library. Remember, you should remove prefix lib and the extension of the library.
The exact name of the option may differ since I'm not using VS2019 in English.

Related

How do I add a library from another branch in VS

My task is to make myself familiar with a given code which also includes a dll and a lib file. I tried the advice given in this post : How to add additional libraries to Visual Studio project? but apparently the lib file I included cannot be opened. I tried to include it at the linker, as suggested in the other post and then tried the file name as well as the entire path at "additional dependencies" but neither of them worked. Any suggestions?
For more details about how to link the .lib, I suggest you could follow the following steps:
1,Add the path to the header file to the Additional Include Directories(property - >c/c++ -> General -> Additional Include Directories)
2,Add the path to the .lib file to the Additional Library Directories (property -> linker -> General -> Additional Library Directories)
3,Add the name of the .lib file with its extension to Additional Dependencies (property -> linker -> input -> Additional Dependencies)
You also need to make sure that you add the configuration properties to the correct build target and platform for your code.
For example:
I suggest you could select "All Platforms" for the platform and select "All Configurations" for the Configuration when changing the properties.

How can one use Boost with Eclipse?

I'm having a lot of trouble installing Boost for use with Eclipse C++ (compiler MinGW).
I first tried downloading the zip at https://sourceforge.net/projects/boost/files/boost/1.61.0/. After it downloaded, I brought it to my second drive, extracted the files there, cd there, and then ran ./bootstrap.bat gcc, which appeared to run successfully.
Then, I ran b2 install --prefix="D:\boostfiles" toolset=gcc and it took about 30 minutes to create a lot of files starting with bin.v2 and ending with rst.
However, #include <boost/asio.hpp> still gives an error. Is there somewhere the files are supposed to be?
For reference, my file structure includes the original boost_1_61_0 extracted folder, a folder that boost was installed to called boostfiles, and a folder called PFiles that includes both eclipse and MinGW.
After doing what I originally posted to install and configure Boost, follow these simple steps:
Go to Project Settings -> C/C++ Build -> Settings:
C++ Compiler -> Includes -> Include paths -> Add...
Add "(directory)\include\boost_x_xx"
C++ Linker -> Libraries -> Library search path -> Add...
Add "(target_directory)\lib"
C++ Linker -> Libraries -> Libraries -> Add...
Add (name of library without beginning "lib" or ending ".a")
For example: libboost_system-mgw49-mt-1_61.a becomes boost_system-mgw49-mt-1_61.
Try adding Boost to the Include and Library search paths.
Go to Project Settings -> C/C++ Build -> Settings:
C++ Compiler -> Includes -> Include paths -> Add...
Add "<target_dir>\include\boost_x_xx"
C++ Linker -> Libraries -> Library search path -> Add...
Add "<target_dir>\lib"
I have the same issue and here is how it is solved.
The path to Boost libraries is ("C:\Program Files\boost\boost_1_62_0")
Go to Project Settings -> C/C++ Build -> Settings:
C++ Compiler -> Includes -> Include paths -> Add...
Add "C:\Program Files\boost\boost_1_62_0"
C++ Linker -> Libraries -> Library search path -> Add...
Add "C:\Program Files\boost\boost_1_62_0\libs"

How do I add a library to my NetBeans C++ project?

I want to use the boost library in order to use some of its functions but I don't know how to do so and cannot seem to find an answer.
I'm currently using NetBeans 8.0.1 ,any help is appreciated.
You have to add two things:
(a) Library header
Go to …
Project Properties -> C++ Compiler -> Include Directories
add the header's directory path there.
(b) Library binaries
Go to …
Project Properties -> Linker -> Additional Libraries Directory
and add the directory path- that's where your library binaries are.
Next add your library at:
Libraries.

undefined reference to 'readline'

I'm trying to use the readline library in my c++ project using netbeans, so I've installed libreadline6-dev and add it to my project Properties -> Linker -> Additional Library directories -> and add (usr/include/readline).
But while compiling I get this error : undefined reference to 'readline'.
I found that I need to add also -lreadline to somewhere, but I have no idea where to put it.
Any ideas.
Thanks
You are on the good way, the problem you got is about the linker.
You have to specify the library(readline) here:
Project properties -> Build -> Linker -> Libraries.
and you also need to specify the path of the library:
Properties -> Linker -> Additional Library directories
But, like nos said, it is not the include directory.The include directory is the headers of the library(.h).
The linker needs a file with the extension .a on UNIX, it should be under a lib directory (ex: /usr/lib depends on where the library is installed).
If it is not working be sure that the file [library_directory]/libreadline.a exists
You also need to link ncurses with your project because readline uses it.

How to get access to external libraries and header files VC10

I'm going to get a book that uses Xerces C++. I'm currently using VS 2010 ultimate, so the program doesn't miss any features. I've downloaded the precompiled binaries for windows x86 VC10. My question is what do I have to do to my environmental variables and files to be able to have Visual studio import the header files i.e. #include . I have no experience linking external libraries, so I need a simple explanation.
Right click on your project -> Properties -> C/C++ -> General -> Additional Include Directories
Include the path of Xerces include files.
For Lib Properties Linker -> General -> Additional Library Directories
Include the path of Xerces lib files.
In Linker -> General -> Input -> Additional dependencies
Add the libs required for linking.