Tag Archives: windows 10

[Solved] Visual studio 2022 error LNK2019: unable to resolve external symbol for

Visual studio 2022 error reporting template:

1>*. Obj: error LNK2019: unresolved external symbol “… Void _cdecl…” (..), Function “…” (…?..) The symbol is referenced in

Detailed errors are as follows:

Generation started...
1>------ Generation has started: Project: BIOP, Configuration:Debug x64 ------
1>pRein.cpp
1>run_models.obj : error LNK2019: Unresolved external symbol "private: void __cdecl bTama::initiate(int,int,int,int)" (?initiate@bTama@@AEAAXHHHH@Z),Function "public: __cdecl bTama::bTama(void)" (??0bTama@@QEAA@XZ) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::insert(struct IntervalSub)" (?insert@bTama@@QEAAXUIntervalSub@@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: bool __cdecl bTama::deleteSubscription(struct IntervalSub)" (?deleteSubscription@bTama@@QEAA_NUIntervalSub@@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::forward_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" (?forward_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@Z),函数 "void __cdecl run_btama_forward(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_forward@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::backward1_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" (?backward1_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::backward2_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" (?backward2_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@Z),Function "void __cdecl run_btama_backward2(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward2@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: int __cdecl bTama::calMemory(void)" (?calMemory@bTama@@QEAAHXZ),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>D:\codes\BIOP\x64\Debug\BIOP.exe : fatal error LNK1120: 7 unresolved external commands
1>The operation to generate the project "BIOP.vcxproj" has been completed-failed.
========== Generation: 0 success, 1 failure, 0 latest, 0 skip ==========

reason:
After adding a new file on another computer or another operating system, submitting it to GitHub, and then returning to the current computer to pull the code, the new file is not imported into the VS project

Solution:
Add the newly created file to the current project, “head/source file→ \rightarrow→Add to→ \rightarrow→Existing items”

An error commandnotfounderror (to initialize your shell) is reported when activating the virtual environment

Error in activating virtual environment

PS E:\projects\Text2Scene_v3> conda activate base

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.

To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - cmd.exe
  - fish
  - tcsh
  - xonsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

Windows10 + vscode
after all the information found on the Internet is used, it is found that it is useless
later, I found out why the previous one was PS (base) or not. As a result, I changed the terminal from power shell to CMD emmmmm~~

Mistakes vary from person to person. It may take a lot of unnecessary time to solve them, but patience will always solve them, rush
If I can’t solve this problem, go and see someone else’s~~

How to Solve Msys2/mingw64 Run cmake GUI Error

August 24, 2021
It has been updated to the latest version.

MINGW64 ~
$ cmake-gui –version
cmake version 3.21.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).

But still error as below:

$ cmake-gui
C:/msys64/mingw64/bin/cmake-gui.exe: error while loading shared libraries: zlib1.dll: cannot open shared object file: No such file or directory

Finally found that the installation of qt5 can be solved

pacman -S mingw-w64-x86_64-qt5
resolving dependencies…
looking for conflicting packages…
Packages (16) mingw-w64-x86_64-assimp-5.0.1-11  mingw-w64-x86_64-dbus-1.12.20-3  mingw-w64-x86_64-double-conversion-3.1.5-1  mingw-w64-x86_64-icu-debug-libs-68.2-3  mingw-w64-x86_64-libgcrypt-1.9.2-2
mingw-w64-x86_64-libgpg-error-1.42-1  mingw-w64-x86_64-libmng-2.0.3-4  mingw-w64-x86_64-libmysofa-1.2-1  mingw-w64-x86_64-libxslt-1.1.34-4  mingw-w64-x86_64-minizip-git-1.2.445.e67b996-2  mingw-w64-x86_64-openal-1.21.1-2
mingw-w64-x86_64-pcre2-10.36-1  mingw-w64-x86_64-qtbinpatcher-2.2.0-4  mingw-w64-x86_64-xpm-nox-4.2.0-6  mingw-w64-x86_64-z3-4.8.9-2  mingw-w64-x86_64-qt5-5.15.2-10
Total Download Size:   223.16 MiB
Total Installed Size:  873.75 MiB
…………………………

then re-run:

cmake-gui

You will be able to value the dialog box of the gui pop-up!

Several solutions to HDF5 error reporting in Python environment

Several solutions to the problem of HDF5 error reporting in Python environment (personal test)
the content of error reporting is as follows:
warning! HDF5 library version mismatched error
the HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as ‘LD_ LIBRARY_ PATH’.
You can, at your own risk, disable this warning by setting the environment
variable ‘HDF5_ DISABLE_ VERSION_ CHECK’ to a value of ‘1’.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.10.4, library is 1.10.5

There are two ways to solve this problem.
first of all, this problem may be the mismatch of HDF5 library, or it may be something similar to warning. I will talk about it in detail below.
The first solution: uninstall HDF5 and then install it again.
The code executed by the terminal is as follows:
CONDA install HDF5
there are many friends on the Internet who use this method to be useful. I personally test that this method is useless to me.
The second solution: check the set path: LD_ LIBRARY_ Path
I personally test: because the system I use is win10, but LD_ LIBRARY_ I couldn’t find the path for a long time. Later, I searched for the path of Linux, so I didn’t use this method.
The third solution: the HDF5_ DISABLE_ VERSION_ Check is set to a higher level, ignoring warnings.
Before import tensorflow, add the following code to the code:
Import OS;
Import OS;
Import OS os.environ [‘HDF5_ DISABLE_ VERSION_ Check ‘] =’2’
my personal test: this method is really useful!