unresolved external symbol, tbsi_context_create, tbsip_context_close - c++

When I compiled my project in Release configuration, it worked fine. However when I compiled it in another configuration it failed with link errors, such as:
unresolved external symbol, tbsi_context_create,PROJECTNAME(FILENAME.obj)

Since it is a link error, I compared the 'additional include directories' and "additional library dependencies', but both are exactly the same. After I tried many other things including a clean rebuild, then I realized that in the configuration that has issues, there is an additional preProcessor in Project Properties->Configuration Properties->c/c++->preProcessors. Removing the preprocessor solves the issue. It is not the first time I came across this link error, but I believe this is the first time that it is caused by an additional preprocessor.

Related

C++ LNK2019 Error, lib has been added to linker

First time I actually started writing a project in C++, for purposes. I'd like to include the TNL library.
The header files are already defined correctly and can use them. For the linker, when i try to use a function that's in the lib file it still gives me a LNK2019 error. The lib is added to the linker.
Error message example:
Here are some screenshots with the paths. I 'think' that i've put them correctly but could definitely looked over something.
Additional Dependencies:
Additional Library Directories
Actual Library Lib's are located at:
I'm probably tunnel-visioning on something. But I'm stuck right now and I'm clueless.
The unresolved symbol is _closesocket#4, which should probably resolve to closesocket() from the Windows sockets library. Try adding "Ws2_32.lib" to the Additional Dependencies line.

Installed MPI but still linker error LNK2019 appears

I've installed MS-MPIv5 from Microsoft and also the debugger for msmpi. In proejct properties in VS2012, I've changed C/C++ -> Additional include libraries adding "$(MSMPI_INC); $(MSMPI_INC)\x64" and also Linker -> All options->Additional Dependencies adding "msmpi.lib;", but VS is still giving me al lot of linker errors such as
error LNK2019: unresolved external symbol _MPI_Barrier#4
unresolved external symbol _MPI_Bcast#20
and so on, with all the mpi functions or type of variables. Is there something I forgot to change or add?
I haven't used 2012, but if it's similar to the older versions of VS then this detailed link may help. In general make sure to do these 3 things:
Add the "Additional Include Directories"
Add the "Additional Library Directories"
Add the "Additional Dependencies" (msimpi.lib)
It sounds like you may be missing the 2nd step?
Try $(MSMPI_INC)x64 (no \)
In my PC
MSMPI_INC=C:\Program Files (x86)\Microsoft SDKs\MPI\Include\

C++ - LNK2019 unresolved external symbol - Can't seem to find what I'm missing

I know this is a common problem and I can see quite a few questions about LNK2019 but I can't for the life of me find what I'm missing.
I am working on a C++ DirectX project and I want to use the DirectXTK library (Direct X Tool Kit). I have included the project in my solution and it builds fine.
I've also included the ScreenGrab.h header I want to use in my own project. Intellisense picks up the function definitions from ScreenGrab.h fine and so I have called SaveDDSTextureToFile().
But when I go to build the project I get the LNK2019 error on SaveDDSTextureToFile(). I'm assuming this means it knows where the definition is (in the header) but can't find the implementation of the function in the .obj or .lib, is this correct?
I assume I need to tell the linker where these files are? I tried doing that in Properties->Configuration Settings->Linker->General->Additional Library Directories but I still get the LNK2019 error.
Does anyone know what I'm still missing?
Thanks for your time.
Stupidly, I didn't add the lib to the Linker oops.
Basically for anyone else that forgets this step - after you've added the directory to Linker->General, go over to Linker->Input and add the name of the .lib to "Additional Dependencies" - so for me I typed "DirectXTK.lib" here (without the quotes).
If I hadn't added the directory to Linker->General I also could have typed "../folder1/folder2/folder-etc/DirectXTK.lib" here depending on the relative path from where my project is.
Sorry for wasting people's time and I hope this helps others.
Make sure your linker->general->additional library directories configuration is for all configurations, and not just "release" or "debug". Try adding the static library file (depending on the Direct3D version you're using) to your project from the SDK directories - if it compiles then you've definitely done something wrong with the linker configurations.

Eclipse CDT indexer - how to solve unresolved includes

I have a workspace with multiple projects, which all compile with no problems. However, some of the projects are giving a lot of warnings in the editor about unresolved symbols, due to unresolved includes. Most are headers from other projects in the workspace, or third party libraries.
Googling suggests this is a problem with the indexer, but I haven't found any coherent explanations of how to fix it - I assume I need to add the paths to these libraries to the indexer's PATH, but I can't see any option to do that (I am using Juno).
Can anyone please explain to me how to configure CDT's indexer?
I am also getting unresolved include warnings for STL headers in two projects. Some STL headers are resolved but others aren't, and the list doesn't seem to be the same between the two projects (one finds things like vector and iostream, but not sstream or string, the other doesn't find iostream either).
Possibly relevant: these are C++ projects, but all the file extensions are .c. I changed the GCC C Compiler command to 'g++' to compile them, but I guess I also need to do something to the indexer settings to cope with it?
I had a similar problem where my project would build but showed unresolved includes in Eclipse Kepler.
In my case I had taken an existing ARM project and created a custom build configuration that used a different tool chain. The new build configuration had all the correct includes, so the project built correctly but the indexer wasn't picking it up.
I fixed it by setting the indexer to use the active build configuration. In Window->Preferences->C/C++->Indexer, under the section labeled "Build configuration for the indexer" I selected "Use active build configuration" and it cleared it up.
Ok, so I've now fixed this issue.
Unresolved includes from other projects in the workspace and third-party libraries was solved by adding the other projects as references. I guess the compiler knew where to look because I'd added the locations to the Includes list, but the indexer didn't (possibly due to eclipse only processing headers once?)
Unresolved includes from STL I fixed by changing all my .c files that were actually C++ to .cpp. Just changing the compile command to 'g++' obviously wasn't enough to tell the indexer to treat the project as C++.
In the case of 1), I needed to clean/rebuild index of the referenced projects first to remove the unresolved include errors.
Right click your project in the workspace, choose Properties -> C++ General -> Paths and Symbols, then add includes and symbols for your specific compiler, add libraries, and other stuff you need on the tabs available. After that hit Apply - it should start re-indexing, and your problems should be gone.
All answers are helpful but there was another trick that solved my problem.
I found out that in contrast to the compiler the indexer does not process subdirectories of included paths. Therefor you need to be more specific when including header files.
Example
#include "subdirectory\include_2.h"
Additional hints :
Right-click your project -> Index -> Search for unresolved includes.
In the search results open the folders and files and see which unresolved inclusions they have.
Find their directories and add them to the Paths and Symbols.

C++ linking error unresolved external symbol

I have a project that includes files from a different project. I am getting linking errors...
"unresolved external symbol "public: _cdecl classA::classA(void"
(??()classA ##QEAA#XZ) referenced in function "class classA *_cdecl
functionB(char const*)" (?functionB##YAPEAVClassA##PEBD#Z)...
and other 125 errors of the same type (after the constructor, which is the error I just listed, every function from the class I use is mentioned in one of the link errors).
The path for including the files of the second project is included in my property sheet. That project, on its own, builds fine.
I have tried to add that project to my solution, and add it as a dependency. No help. I have tried to add the dll that it creates in the project - linker - input. No help.
In Configuration properties, the Runtime Library is set to /MTd.
I have even tried to add extern "C" in front of my include. No help.
I have tried to build them with Debug or Release, x64 or Win32. I prefer Release x64 but I'll take anything.
Could you please help me - tell me what am I doing wrong, or where to look to fix this problem ? Thank you very much.
When you build the project which yours depends on, it should produce both a lib and a dll. You need to link that lib with your project. See this thread for a screenshot of how to link the lib in your project.
I found out that my dependencies in the Link - Input were being removed by the fact that I didn't explicitly specify that I can have dependencies in the property sheet. After changing the property sheet, I finally was able to create a dll.