larschrjensen
Denmark
Asked
— Edited
Resolved by ptp!
I am having some trouble getting visual studio (vs2013) to recognize the EZ_B namespace in a new c++ project. It works fine in the Example Project from the SDK though. However, because of other components (specifcally YARP) I need to compile using CMake. My CMakeLists.txt looks like this:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
SET(PROJECTNAME ez)
PROJECT(${PROJECTNAME})
find_package(YARP)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${YARP_MODULE_PATH})
include_directories(${YARP_INCLUDE_DIRS})
add_executable(ez ez.cpp)
target_link_libraries(ez ${YARP_LIBRARIES})
So, can I include the EZ_B.dll already in cmake, and if not how can I add it to the solution that cmake generates?
Lars,
In c++ world: To allow an executable to load/execute a DLL you need implicit (or explicit) link, for that you need to obtain a header file .h which contains the classes/declarations and you need a .LIB file which is used by the linker to create the call references between your code and the external lib.
there are cmake commands to specify the header and library location(s)
BUT you are not in c++ world, EZ_B is not a regular c++ library is a .NET managed library and can't be used as a regular library linked to plain c++ code.
what you have in ez.cpp is a c++/CLI extensions, which only visual studio can understand and compile, also you need to pass compiler directives to the visual studio.
In your cmake i don't see specific commands for the visual studio.
some examples:
clr compilation and exception management:
to include .net references:
probably you will need more commands, but at least those two are missing.
Hi ptp,
Yes I know it's a pain, but there's no way around c++ at the time.
However, your feedback did the trick. Thanks a lot. Just made my life a bit easier
Best regards, Lars
@larschrjensen
Can you drop me an email, i would like to exchange some ideas how to integrate with the yarp framework.
my email (is in my profile):
https://www.ez-robot.com/User/ptp/Profile/
Thanks
@ptp
I've sent you an email!