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

ConvBin Depends on GUI extern functions #621

Open
geoeo opened this issue Jul 30, 2021 · 2 comments
Open

ConvBin Depends on GUI extern functions #621

geoeo opened this issue Jul 30, 2021 · 2 comments

Comments

@geoeo
Copy link

geoeo commented Jul 30, 2021

I am trying to build the convbin app from source my cmake is as follows:

cmake_minimum_required(VERSION 3.20)
project(rtklib C)

file(GLOB_RECURSE SOURCES "src/*.*")
file(GLOB_RECURSE SOURCES_2 "src/rcv/*.*")

include_directories(src)

add_library(rtklib
        SHARED
        ${SOURCES}
        ${SOURCES_2})

target_include_directories(rtklib PUBLIC src)
target_include_directories(rtklib PUBLIC src/rcv)

target_link_libraries(rtklib PUBLIC pthread m)

install(TARGETS rtklib LIBRARY
        DESTINATION lib COMPONENT library
        CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})


add_executable(rnx2rtkp app/rnx2rtkp/rnx2rtkp.c)
target_link_libraries(rnx2rtkp rtklib)

add_executable(convbin app/convbin/convbin.c )
target_link_libraries(convbin rtklib)

But I am getting the link errors for convbin: (rnx2rtkp works)

/usr/bin/ld: librtklib.so: undefined reference to `settspan'
/usr/bin/ld: librtklib.so: undefined reference to `settime'

I checked and these are defined in postmain.cpp which is a different app and has gui dependencies which I want to avoid.
How can I build convbin from sources as a purely CLI tool?

@geoeo geoeo changed the title ConvBin Depend on GUI extern functions ConvBin Depends on GUI extern functions Jul 30, 2021
@geoeo
Copy link
Author

geoeo commented Jul 30, 2021

I fixed this my adding empty method stubs to convbin.c.
Not sure why its searching for these though

@yangtseJin
Copy link

you should use the static library instead of dynamic library, such as

add_library(rtklib
        STATIC
        ${SOURCES}
        ${SOURCES_2})

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

No branches or pull requests

2 participants