Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Load DLL Created using this library namespace not found #78

Closed
SpartanJ opened this issue Dec 24, 2014 · 1 comment
Closed

Comments

@SpartanJ
Copy link
Owner

Original report by Sarvagya Pant (Bitbucket: sarvpant, ).


I have been successful in running this library using visual studio but the same is giving me Intellisense and namespace error when making the dll. I have following CMakeLists.txt file:

#!Makefile

SET(TARGET integrity_monitor)
message("\n Building ${TARGET}")
cmake_policy(SET CMP0015 NEW)
project(${TARGET})

SET(SOURCE
  IntegrityMonitor.cpp 
)

SET(HEADERS
  IntegrityMonitor.h ../BaseApplication.hpp 
)

include_directories("..\\..\\..\\ext_library\\SpartanJ-efsw-linux\\src")
include_directories("..\\..\\..\\ext_library\\SpartanJ-efsw-linux\\include")
LINK_DIRECTORIES("..\\..\\..\\ext_library\\SpartanJ-efsw-linux\\lib")

set(Boost_USE_STATIC_LIBS       OFF)
set(Boost_USE_MULTITHREADED      ON)
set(Boost_USE_STATIC_RUNTIME    OFF)
find_package(Boost 1.55.0 COMPONENTS thread filesystem system)

if(Boost_FOUND)
    add_definitions(-DDLL_EXPORTS)
    add_definitions(-DBOOST_ALL_DYN_LINK)
    include_directories("..\\..\\..\\ext_library\\zmq\\zeromq-4.0.3\\include")
    include_directories("..\\..\\..\\ext_library\\zmq\\czmq\\czmq-2.1.0\\include")
    link_directories("..\\..\\..\\ext_library\\zmq\\zeromq-4.0.3\\lib\\Win32\\Debug")
    link_directories("..\\..\\..\\ext_library\\zmq\\czmq\\czmq-2.1.0\\lib\\Win32\\DebugDLL")
    include_directories(${Boost_INCLUDE_DIRS})
    LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
    add_library(${TARGET} SHARED ${SOURCE} ${HEADERS})
    target_link_libraries(${TARGET} ${Boost_LIBRARIES} czmq efsw-static-debug)
    
else()
    message(STATUS "Boost_FOUND False")
endif()

Basically the problem is, the same code runs when compiled as executable, but gives intellisense errors in Visual studio 10 when created a DLL. Do I need to add something in my CMakeLists.txt file

@SpartanJ
Copy link
Owner Author

Original comment by Sarvagya Pant (Bitbucket: sarvpant, ).


I did resolved the issue. In Cmakelist file of DLL generating solution, I had to include src and include of SpartanJ-efsw-linux. It was so silly of me to not discover earlier. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant