Unresolved external Vcl::Filectrl::SelectDirectory - c++

I am using Vcl::Filectrl::SelectDirectory() in C++ Builder 10.3.1 but I receive error:
[ilink32 Error] Error: Unresolved external '__fastcall Vcl::Filectrl::SelectDirectory(System::UnicodeString, System::WideString, System::UnicodeString&, System::Set<Vcl::Filectrl::TSelectDirExtOpt, 0, 5>, Vcl::Controls::TWinControl *)' referenced from
What library should I link to resolve the error?

In C++ Builder 10.3.1, vclx.lib should be linked. Change the following line in the project file:
<AllPackageLibs>rtl.lib;vcl.lib;</AllPackageLibs>
to
<AllPackageLibs>rtl.lib;vcl.lib;vclx.lib</AllPackageLibs>

Add the following line to your C++ file:
#pragma link "vclx.lib"

Related

Why I get unresolved external errors when I want to link the release version of the static library TinyXML 2 in C++ Builder Starter?

I got a simple question. I read that linking debug static libraries to release executables is considered a bad thing. So I compiled the static library of TinyXML 2 in release mode. Library compiled without any errors. But when I want to link the release static library library with the release version of my example application I get the following output:
Checking project dependencies...
Building PrjTinyXML2_App.cbproj (Release, Win32)
bcc32 command line for "main.cpp"
c:\program files (x86)\embarcadero\studio\18.0\bin\bcc32.exe -DNDEBUG -n.\Win32\Release -I"C:\Program Files
(x86)\Embarcadero\Studio\18.0\include\boost_1_39\boost\tr1\tr1";"C:\Program Files (x86)\Embarcadero\Studio\18.0\include\boost_1_39";"c:\program files
(x86)\embarcadero\studio\18.0\include";"c:\program files (x86)\embarcadero\studio\18.0\include\dinkumware";"c:\program files
(x86)\embarcadero\studio\18.0\include\windows\crtl";"c:\program files (x86)\embarcadero\studio\18.0\include\windows\sdk";"c:\program files
(x86)\embarcadero\studio\18.0\include\windows\rtl";"c:\program files (x86)\embarcadero\studio\18.0\include\windows\vcl";"c:\program files
(x86)\embarcadero\studio\18.0\include\windows\fmx";C:\Users\Public\Documents\Embarcadero\Studio\18.0\hpp\Win32;
C:\Users\Public\Documents\Embarcadero\Studio\18.0\hpp\Win32 -Q -c -tC -C8 -o.\Win32\Release\main.obj -w-par -O2 -v- -vi
-H=.\Win32\Release\PrjTinyXML2_App.pch -H main.cpp
brcc32 command line for "PrjTinyXML2_App.vrc"
c:\program files (x86)\embarcadero\studio\18.0\bin\cgrc.exe -c65001 PrjTinyXML2_App.vrc -foPrjTinyXML2_App.res
ilink32 command line
c:\program files (x86)\embarcadero\studio\18.0\bin\ilink32.exe -G8 -L.\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Debug;"c:\program files
(x86)\embarcadero\studio\18.0\lib\win32\release";"c:\program files (x86)\embarcadero\studio\18.0\lib\win32\release\psdk";
C:\Users\Public\Documents\Embarcadero\Studio\18.0\DCP -j.\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Release;
C:\Users\Donald\Documents\Embarcadero\Studio\Projects\TinyXML2_Static_lib\Win32\Debug;"c:\program files
(x86)\embarcadero\studio\18.0\lib\win32\release";"c:\program files (x86)\embarcadero\studio\18.0\lib\win32\release\psdk";
C:\Users\Public\Documents\Embarcadero\Studio\18.0\DCP -l.\Win32\Release -Tpe c0x32 .\Win32\Release\main.obj , .\Win32\Release\PrjTinyXML2_App.exe ,
.\Win32\Release\PrjTinyXML2_App.map , PrjTinyXML2_lib.lib import32.lib cw32.lib , , PrjTinyXML2_App.res
[ilink32 Error] Error: Unresolved external '___seh_personality_v0' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__Unwind_SjLj_Register' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__cxxabiv1::__si_class_type_info::' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '___cxa_pure_virtual' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '___cpp_terminate' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__Unwind_SjLj_Unregister' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external 'tinyxml2::StrPair::~StrPair()' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_APP\WIN32\RELEASE\MAIN.OBJ
[ilink32 Error] Error: Unresolved external '__cxxabiv1::__class_type_info::' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unresolved external '__Unwind_Resume' referenced from C:\USERS\DONALD\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\TINYXML2_STATIC_LIB\WIN32\RELEASE\PRJTINYXML2_LIB.LIB|tinyxml2
[ilink32 Error] Error: Unable to perform link
Failed
Elapsed time: 00:00:02.3
If I compile the application with the debug static TinyXML 2 library it compiles ok. Am I doing something wrong? I use C++ Builder 10.1 Berlin Update 2 Starter.
Looks like your issue is linked to compiler options in release mode.
Could you have a look on "Exception handling" options?
___seh_personality_v0 and __Unwind_SjLj_Register are "Exception handler" functions.

fail to install chromium embedded on C++ Builder from Delphi files

I want to install chromium embedded on C++ Builder v.6 . I already installed it once long time ago, and i developed some applications using TChromium. But after I reinstalled the OS, I'm trying to install this component again. When I compile the delphi pascal units I'm getting linker errors:
Build
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::~TCustomOutline()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::TCustomOutline(Classes::TComponent *)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetOutlineStyle(Outline::TOutlineStyle)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetOutlineOptions(System::Set<Outline::TOutlineOption, 0, 2>)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::GetPicture(int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetPicture(int, Graphics::TBitmap *)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::GetFullPath()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::HasChildren()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::getFirstChild()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::GetNextChild(int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Insert(int, const System::AnsiString)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::GetLastChild()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Add(int, const System::AnsiString)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::AddChild(int, const System::AnsiString)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Get(int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Clear()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TOutlineNode::SetExpandedState(bool)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetSelectedItem(int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Click()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::GetSelectedItem()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Expand(int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::Loaded()' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external 'Outline::TCustomOutline::' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::DefineProperties(Classes::TFiler *)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::DrawCell(int, int, const Types::TRect&, System::Set<Grids::Grids__3, 0, 2>)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__tpdsc__ Outline::TCustomOutline' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetItemHeight(int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::StoreBitmap(int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
[Linker Error] Unresolved external '__fastcall Outline::TCustomOutline::SetStyle(Outline::TOutlineType)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
I just clicked Component -> Install Component -> Selected the cefvcl.pas and then when i click compile I'm getting above results.
How to install the chromium on BCB6, or how to solve this issues?
UPDATE:
also when I try to compile I'm getting Undeclared indentifer error for line where is this code:
TThread.Synchronize(nil, sync.Execute);
I'm just bypassing it by removing the syncronize , so the line after that look like:
sync.Execute;
UPDATE2
If I'm trying other way to install the component, I'm creating new package and save it, then add 4 files to it:
cefreg.pas
ceflib.pas
cefvcl.pas
cefgui.pas
then i replace TThread.Synchronize(nil, sync.Execute); with sync.Execute; to bypass errors, but after that i still have one issue:
[Linker Fatal Error] Fatal: Unable to open file 'APPEVNTS.OBJ'
You're installing the selected component into the IDE's default custom-component package. That package evidently makes reference to the TOutline component, but that component isn't defined in the package. Normally, TOutline is in the vclsmp package, so add vclsmp to your component package's requires list.
Preferably, use a different and more typical technique for installing the Chromium control. Instead of adding just one unit to the default custom-component package, install the ready-made package that comes with the Chromium component: Open the .dpk file corresponding to your Delphi version, compile it, and install it. If there isn't a package file for your product version, then simply add the four source files to a new package; use the existing .dpk files as examples.
Some of your troubles may be because the library was written to target later product versions than 2002's C++ Builder 6. For example, it seems to expect TThread to have a two-argument version of Synchronize and for there to be an AppEvnts unit. Simply deleting the things you don't have without understanding them isn't the way to fix that, especially when threads are involved.
All the source files reference cef.inc, which sets conditional defines according to the compiler version. If it doesn't recognize your compiler version, you'll have to edit it so that it sets the various version symbols and feature symbols to accurately describe your compilation environment.

MSVC: Using link.exe manually

I'm attempting to set up a build system named Waf with a test C++ OpenGL/SDL project, and am running into a few issues with the linking process. As far as I can tell, all of the libraries are being found properly, and being added into the linking command, and yet the linking process seems to be acting as if the libraries aren't linked.
In order to attempt to debug the process, I was trying to run the compilation/link process manually in order to understand exactly how it works with MSVC, but I'm still getting issues. When I run the following LINK.exe command:
PS C:\Users\covertcj\Documents\projects\test> & "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\LINK.exe"
/NOLOGO /MANIFEST /SUBSYSTEM:CONSOLE /MACHINE:x64 /VERBOSE
.\build\src\main.cpp.1.o
/OUT:.\build\test.exe
/LIBPATH:C:\Users\covertcj\Documents\projects\test\lib /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64"
opengl32.lib sdl.lib sdlmain.lib
I get the same error as usual:
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_CreateWindow referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_DestroyWindow referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_GL_CreateContext referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_GL_SwapWindow referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_GL_DeleteContext referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_PollEvent referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_Delay referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_Init referenced in function SDL_main
main.cpp.1.o : error LNK2019: unresolved external symbol SDL_Quit referenced in function SDL_main
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
However, I also get some interesting verbose output:
Searching libraries
Searching C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\opengl32.lib:
Searching C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdl.lib:
Searching C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdlmain.lib:
Searching C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\LIBCMT.lib:
Found _load_config_used
Loaded LIBCMT.lib(loadcfg.obj)
Searching C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\OLDNAMES.lib:
Searching C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\kernel32.lib:
Finished searching libraries
Unused libraries:
C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdl.lib
C:\Users\covertcj\Documents\projects\dungeonhg\lib\sdlmain.lib
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\OLDNAMES.lib
However, my code most definitely uses SDL and SDLmain:
main.cpp
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
int main(int argc, char *argv[]) {
SDL_Init(SDL_INIT_VIDEO); // Init SDL2
// Create a window. Window mode MUST include SDL_WINDOW_OPENGL for use with OpenGL.
SDL_Window *window = SDL_CreateWindow(
"SDL2/OpenGL Demo", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE
);
...
Anybody know what I'm doing wrong here?
EDIT: I have also verified that the same waf script works on both linux and osx, so it seems to be windows specific.
I think your main problem is
error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
which might be the one error where everything else hinges. If I had to guess, I would have to assume that you forgot to add a "main" function... although apparently you didn't, as I can clearly see it in your posting.

JSONCPP Amalgamated link errors

I am trying to use the amalgamated version of jsoncpp(the latest version), but it is producing unresolved external symbol link errors. The code I am using is
#include <json/json.h>
int main(){
Json::Value root;
return 0;
}
and it is giving me the error
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Json::Value::~Value(void)" (??1Value#Json##QAE#XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Json::Value::Value(enum Json::ValueType)" (??0Value#Json##QAE#W4ValueType#1##Z) referenced in function _main
Probably you didn't include the JSONCPPs *.cpp file into your project (they have to be compiled and linked). If the library gets compiled to a static library, you have to tell the linker what to link.
I got this when trying to link x86 version of JsonCpp in my x64 build. I did not notice that Vcpkg behaves as if VCPKG_DEFAULT_TRIPLET=x86-windows was defined, unless it's told otherwise.
I saw the following entry in the build log when that was happening
C:\Tools\vcpkg\installed\x86-windows\debug\lib\jsoncpp.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64' [C:\projects\qpid-proton\BLD\cpp\qpid-proton-cpp.vcxproj]

Problem compiling Platform SDK program

I'm trying to compile the example from here;
http://msdn.microsoft.com/en-us/library/ms682619(VS.85).aspx
I've installed the Platform SDK, but I'm getting these errors;
Error 1 error LNK2019: unresolved external symbol _GetDeviceDriverBaseNameW#12 referenced in function _main DriverChecker.obj DriverChecker
Error 2 error LNK2019: unresolved external symbol _EnumDeviceDrivers#12 referenced in function _main DriverChecker.obj DriverChecker
Error 3 fatal error LNK1120: 2 unresolved externals C:\Files\Projects\VS2008\DriverChecker\Debug\DriverChecker.exe DriverChecker
Anyone any idea how to get this compiling correctly?
You just need to add psapi.lib as an additional library in your linker options.
Edit properties for your project, navigate to Linker->Input, and type "psapi.lib" where it says Additional Dependencies.