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

Static only build fails #28

Open
rahul-bedarkar opened this issue Apr 20, 2017 · 2 comments
Open

Static only build fails #28

rahul-bedarkar opened this issue Apr 20, 2017 · 2 comments

Comments

@rahul-bedarkar
Copy link

Hello,

I'm trying to add LetMeCreate package in Buildroot. While testing it in static only environment, build fails with following errors.

rahul@rahul-Aspire-4736Z:~/upstream/LetMeCreate/build$ cmake .. -DBUILD_SHARED=OFF
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rahul/upstream/LetMeCreate/build

rahul@rahul-Aspire-4736Z:~/upstream/LetMeCreate/build$ make
Scanning dependencies of target letmecreate_core_s
[ 1%] Building C object CMakeFiles/letmecreate_core_s.dir/src/core/uart.c.o
In file included from /home/rahul/upstream/LetMeCreate/src/core/uart.c:9:0:
/home/rahul/upstream/LetMeCreate/include/letmecreate/core/common.h:17:37: fatal error: letmecreate/core/export.h: No such file or directory
compilation terminated.
CMakeFiles/letmecreate_core_s.dir/build.make:62: recipe for target 'CMakeFiles/letmecreate_core_s.dir/src/core/uart.c.o' failed
make[2]: *** [CMakeFiles/letmecreate_core_s.dir/src/core/uart.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/letmecreate_core_s.dir/all' failed
make[1]: *** [CMakeFiles/letmecreate_core_s.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Thanks,
Rahul

@ghost
Copy link

ghost commented Apr 20, 2017

Hello Rahul,
CMake generates the export files:

./include/letmecreate/rpisensehat/export.h
./include/letmecreate/click/export.h
./include/letmecreate/core/export.h
./include/letmecreate/bosch/export.h

Can you try running cmake . -DBUILD_SHARED=OFF from ~/upstream/LetMeCreate ? I suspect running it from a subdirectory does not work.

François

@rahul-bedarkar
Copy link
Author

Running cmake in source directory didn't help, it is failing with same error. Probably you have CMake generated files present from previous configuration.

generate_export_header() is only called if BUILD_SHARED is set. So CMake won't be generating export headers in case of static only builds.

I think export headers are only meant to be used in shared library cases as static libraries are just archive of object files where there is no visibility.

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

1 participant