iisys-hof / map-matching-2

High Performance Map Matching with Markov Decision Processes (MDPs) and Hidden Markov Models (HMMs).
GNU Affero General Public License v3.0
43 stars 8 forks source link

rpmalloc.lib(rpmalloc.c.obj) : error LNK2001 #4

Open RuohanLixyf opened 1 day ago

RuohanLixyf commented 1 day ago

is there anyone has the same issue below? When i use the 'cmake --build .'

[5/5] Linking CXX executable src\map_matching_2.exe
FAILED: src/map_matching_2.exe
C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=src\CMakeFiles\map_matching_2.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\link.exe /nologo src\CMakeFiles\map_matching_2.dir\main.cpp.obj  /out:src\map_matching_2.exe /implib:src\map_matching_2.lib /pdb:src\map_matching_2.pdb /version:0.0 /machine:X86 /INCREMENTAL:NO /subsystem:console  /INCREMENTAL:NO /LTCG  _deps\rpmalloc-build\rpmalloc.lib  src\app\app.lib  src\library\library.lib  _deps\boost-build\lib\libboost_thread-vc143-mt-s-x32-1_86.lib  _deps\boost-build\lib\libboost_chrono-vc143-mt-s-x32-1_86.lib  _deps\boost-build\lib\libboost_serialization-vc143-mt-s-x32-1_86.lib  _deps\gpx-build\gpx\gpx.lib  _deps\zlib-build\zlibstatic.lib  _deps\expat-build\libexpatMT.lib  _deps\bz2-build\bz2_static.lib  _deps\boost-build\lib\libboost_program_options-vc143-mt-s-x32-1_86.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\link.exe /nologo src\CMakeFiles\map_matching_2.dir\main.cpp.obj /out:src\map_matching_2.exe /implib:src\map_matching_2.lib /pdb:src\map_matching_2.pdb /version:0.0 /machine:X86 /INCREMENTAL:NO /subsystem:console /INCREMENTAL:NO /LTCG _deps\rpmalloc-build\rpmalloc.lib src\app\app.lib src\library\library.lib _deps\boost-build\lib\libboost_thread-vc143-mt-s-x32-1_86.lib _deps\boost-build\lib\libboost_chrono-vc143-mt-s-x32-1_86.lib _deps\boost-build\lib\libboost_serialization-vc143-mt-s-x32-1_86.lib _deps\gpx-build\gpx\gpx.lib _deps\zlib-build\zlibstatic.lib _deps\expat-build\libexpatMT.lib _deps\bz2-build\bz2_static.lib _deps\boost-build\lib\libboost_program_options-vc143-mt-s-x32-1_86.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1120) with the following output:
   Creating library src\map_matching_2.lib and object src\map_matching_2.exp
rpmalloc.lib(rpmalloc.c.obj) : error LNK2001: unresolved external symbol _rpmalloc_module_init
src\map_matching_2.exe : fatal error LNK1120: 1 unresolved externals
ninja: build stopped: subcommand failed.
addy90 commented 1 day ago

Hi, thank you for trying out my tool!

Can you please start building from scratch and post the full commands and logfiles (as attachment)? In case there is private information like your name, you can of course censor (replace with XXXXX) in your logfile. Please also post your Windows and compiler information, which version you are using.

From your output I don't know if there were errors during configuration time. The dependencies are built during configuration (the first CMake command) and thus the build of course fails if there were errors at configuration time.

Because the builds are cached to some extent during configuration, please delete the build directory in advance before you do it again.

Moreover: Do you have "Windows Long Paths" enabled as I explained in the README at "Hint for Windows building"? In case you only receive the error with rpmalloc, you can disable that library in particular with -DENABLE_RPMALLOC=OFF CMake command during configuration, but I am not sure if this is the issue or the error happens at an earlier time during your build.

Using the prebuild binaries is not an option for you I suppose?

Thank you!

EDIT: Okay I found something out after editing your log above so that it is better readable: You are using a 32-bit compiler. This must be the issue. See also the issue rpmalloc#305. Please use a 64-bit compiler. I will soon update the README to explain that only 64-bit compilers are tested and supported! You might need to use -DCMAKE_GENERATOR_PLATFORM=x64 or -A x64 during CMake configuration and delete the build directory before. I will check that out later again and update the README.