eclipse-ecal / ecal

📦 eCAL - enhanced Communication Abstraction Layer. A high performance publish-subscribe, client-server cross-plattform middleware.
https://ecal.io
Apache License 2.0
831 stars 174 forks source link

Linker error : libprotobufd.lib(any_lite.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4 #1238

Closed navaneecse closed 6 months ago

navaneecse commented 11 months ago

Problem Description

I try to build a C++ example with the ecal release for windows. The installation worked, and I tried the c++ example. Trying to build a simple C++ demo gives me the following error: Linking Error: libprotobufd.lib(any_lite.obj) : error LNK2001: unresolved external symbol CxxFrameHandler4 libprotobufd.lib(io_win32.obj) : error LNK2001: unresolved external symbol GSHandlerCheck_EH4 libprotobufd.lib(map_field.obj) : error LNK2001: unresolved external symbol imp_std_init_once_begin_initialize

Facing the above errors in the below sample program 7.2. Hello World with protobuf : https://eclipse-ecal.github.io/ecal/getting_started/hello_world_proto.html

How to reproduce

mkdir _build cd _build cmake .. -A x64 cmake --build . --parallel

How did you get eCAL?

Download from Release Page

Environment

eCAL v5.12.0 Windows 10 Py3.6 Cmake3.17

eCAL System Information

No response

FlorianReimold commented 11 months ago

I just tried it out in order to check if the Hello World Project has an issue, but it worked for me.

I am using:

Here is the output of my cmake and build command (it throws way too many warnings regarding missing PDB files, I know. Sorry for that.)

Maybe you could tell us more about your Visual Studio Version and also post your cmake + build output of a clean build (delete the _build directory first)

The following output is fine, despite the warnings:

C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build>cmake .. -A x64
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.37.32824.0
-- The CXX compiler identification is MSVC 19.37.32824.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at C:/eCAL/cmake/qt/qt_windeployqt.cmake:20 (set):
  Cannot set "qt_windeployqt_cmake_path": current scope has no parent.
Call Stack (most recent call first):
  C:/eCAL/cmake/cmake_functions.cmake:34 (include)
  C:/eCAL/cmake/CMakeFunctionsConfig.cmake:28 (include)
  C:/eCAL/lib/cmake/eCAL/eCALConfig.cmake:71 (find_package)
  CMakeLists.txt:9 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Configuring done (9.1s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/uid38621/Desktop/Hello World/protobuf_snd/_build

C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build> cmake --build . --parallel
MSBuild-Version 17.7.2+d6990bcfa für .NET Framework

  Checking Build System
  Running C++ protocol buffer compiler on C:/Users/uid38621/Desktop/Hello World/proto_messages/hello_world.proto
  Building Custom Rule C:/Users/uid38621/Desktop/Hello World/protobuf_snd/CMakeLists.txt
  main.cpp
  hello_world.pb.cc
libprotobufd.lib(common.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(common.obj)' or at ''; link
ing object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(message_lite.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(message_lite.obj)' or
 at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxp
roj]
libprotobufd.lib(repeated_field.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(repeated_field.obj)
' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.
vcxproj]
libprotobufd.lib(descriptor.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(descriptor.obj)' or at
''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(message.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(message.obj)' or at ''; li
nking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(descriptor.pb.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(descriptor.pb.obj)'
or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vc
xproj]
libprotobufd.lib(generated_message_util.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(generated_m
essage_util.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_bui
ld\protobuf_snd.vcxproj]
libprotobufd.lib(stringpiece.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(stringpiece.obj)' or a
t ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxpro
j]
libprotobufd.lib(coded_stream.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(coded_stream.obj)' or
 at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxp
roj]
libprotobufd.lib(arena.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(arena.obj)' or at ''; linkin
g object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(wire_format_lite.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(wire_format_lite.
obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_
snd.vcxproj]
libprotobufd.lib(parse_context.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(parse_context.obj)'
or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vc
xproj]
libprotobufd.lib(unknown_field_set.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(unknown_field_se
t.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobu
f_snd.vcxproj]
libprotobufd.lib(generated_message_reflection.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(gener
ated_message_reflection.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\proto
buf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(reflection_ops.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(reflection_ops.obj)
' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.
vcxproj]
libprotobufd.lib(wire_format.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(wire_format.obj)' or a
t ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxpro
j]
libprotobufd.lib(status.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(status.obj)' or at ''; link
ing object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(int128.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(int128.obj)' or at ''; link
ing object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(strutil.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(strutil.obj)' or at ''; li
nking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(zero_copy_stream.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(zero_copy_stream.
obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_
snd.vcxproj]
libprotobufd.lib(zero_copy_stream_impl_lite.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(zero_co
py_stream_impl_lite.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_
snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(zero_copy_stream_impl.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(zero_copy_st
ream_impl.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build
\protobuf_snd.vcxproj]
libprotobufd.lib(implicit_weak_message.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(implicit_wea
k_message.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build
\protobuf_snd.vcxproj]
libprotobufd.lib(stringprintf.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(stringprintf.obj)' or
 at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxp
roj]
libprotobufd.lib(text_format.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(text_format.obj)' or a
t ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxpro
j]
libprotobufd.lib(tokenizer.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(tokenizer.obj)' or at ''
; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(descriptor_database.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(descriptor_dat
abase.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\pro
tobuf_snd.vcxproj]
libprotobufd.lib(dynamic_message.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(dynamic_message.ob
j)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_sn
d.vcxproj]
libprotobufd.lib(substitute.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(substitute.obj)' or at
''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(strtod.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(strtod.obj)' or at ''; link
ing object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(map_field.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(map_field.obj)' or at ''
; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(extension_set.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(extension_set.obj)'
or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vc
xproj]
libprotobufd.lib(extension_set_heavy.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(extension_set_
heavy.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\pro
tobuf_snd.vcxproj]
libprotobufd.lib(structurally_valid.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(structurally_va
lid.obj)' or at ''; linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\proto
buf_snd.vcxproj]
libprotobufd.lib(io_win32.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(io_win32.obj)' or at '';
linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(any_lite.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(any_lite.obj)' or at '';
linking object as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
libprotobufd.lib(any.obj) : warning LNK4099: PDB '' was not found with 'libprotobufd.lib(any.obj)' or at ''; linking ob
ject as if no debug info [C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\protobuf_snd.vcxproj]
  protobuf_snd.vcxproj -> C:\Users\uid38621\Desktop\Hello World\protobuf_snd\_build\Debug\protobuf_snd.exe
  Building Custom Rule C:/Users/uid38621/Desktop/Hello World/protobuf_snd/CMakeLists.txt