microsoft / VSLinux

VS extension for C++ Linux development
205 stars 34 forks source link

using linux includes in makefile projects? #126

Closed dixonqmg closed 6 years ago

dixonqmg commented 7 years ago

When I try to create a makefile project, and use linux include directories, intellisense produces tons of errors. Mostly related to types like __int128 inside system includes. Also place like below in pthread.h

extern int pthread_create (pthread_t *__restrict __newthread,
               const pthread_attr_t *__restrict __attr,
               void *(*__start_routine) (void *),
               void *__restrict __arg) __THROWNL __nonnull ((1, 3));

produce errors on _THROWNL

inside boost it fails on those

#ifdef __clang__
#if __has_include(<experimental/any>)
#  define BOOST_LIBSTDCXX_VERSION 50100
#elif __has_include(<shared_mutex>)
#  define BOOST_LIBSTDCXX_VERSION 40900
#elif __has_include(<ext/cmath>)
#  define BOOST_LIBSTDCXX_VERSION 40800
#elif __has_include(<scoped_allocator>)
#  define BOOST_LIBSTDCXX_VERSION 40700
#elif __has_include(<typeindex>)
#  define BOOST_LIBSTDCXX_VERSION 40600
#elif __has_include(<future>)
#  define BOOST_LIBSTDCXX_VERSION 40500
#elif  __has_include(<ratio>)
#  define BOOST_LIBSTDCXX_VERSION 40400
#elif __has_include(<array>)
#  define BOOST_LIBSTDCXX_VERSION 40300
#endif`

because clang is defined, but it doesn't understand __has_include

Obviously I need some kind of a forced include with properly defined preprocessor symbols, but I can't figure out what needs to be in there. Producing an include file with everything defined in gcc didn't fix the situation.

robotdad commented 7 years ago

Do you have your headers copied locally and referenced within the makefile project?

dixonqmg commented 7 years ago

Yes of course

Sent from my iPhone

On Aug 15, 2017, at 6:08 PM, Marc Goodner notifications@github.com wrote:

Do you have your headers copied locally and referenced within the makefile project?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

boskars commented 7 years ago

You can get information on which include folders gcc is using and in which order, both for C and C++. In my configuration they are different so ideally the $(ISenseIncludePath) should be available both for C and C++.

Include search directories: C plus plus

root@imx6ul-var-dart:~/sr/bin# echo | gcc -xc++ -Wp,-v - ignoring duplicate directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include" ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/../../../../arm-poky-linux-gnueabi/include"

include "..." search starts here:

include <...> search starts here:

/usr/include/c++/5.2.0 /usr/include/c++/5.2.0/arm-poky-linux-gnueabi /usr/include/c++/5.2.0/backward /usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include /usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include-fixed /usr/include End of search list.

Include search directories: C plus plus

root@imx6ul-var-dart:/usr/bin# echo | gcc -E -Wp,-v - ignoring duplicate directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include" ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/../../../../arm-poky-linux-gnueabi/include"

include "..." search starts here:

include <...> search starts here:

/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include /usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include-fixed /usr/include End of search list.

dixonqmg commented 7 years ago

Intellisense is using the correct includes. It doesn’t have correct built-ins defined for them, that’s my problem.

On Aug 16, 2017, at 5:43 AM, boskars notifications@github.com wrote:

You can get information on which include folders gcc is using and in which order, both for C and C++. In my configuration they are different so ideally the $(ISenseIncludePath) should be available both for C and C++.

Include search directories: C plus plus

root@imx6ul-var-dart:~/sr/bin# echo | gcc -xc++ -Wp,-v - ignoring duplicate directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include" ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/../../../../arm-poky-linux-gnueabi/include"

include "..." search starts here:

include <...> search starts here:

/usr/include/c++/5.2.0 /usr/include/c++/5.2.0/arm-poky-linux-gnueabi /usr/include/c++/5.2.0/backward /usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include /usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include-fixed /usr/include End of search list.

Include search directories: C plus plus

root@imx6ul-var-dart:/usr/bin# echo | gcc -E -Wp,-v - ignoring duplicate directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include" ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/../../../../arm-poky-linux-gnueabi/include"

include "..." search starts here:

include <...> search starts here:

/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include /usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include-fixed /usr/include End of search list.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/VSLinux/issues/126#issuecomment-322732756, or mute the thread https://github.com/notifications/unsubscribe-auth/AYChLI4rj0GcZs7um8_S_mz1vmZ7JLbgks5sYsfKgaJpZM4M75aO.

robotdad commented 7 years ago

I think I've got what I need to try to reproduce this and figure out what's going on. I'm not going to be able to look at it until Monday though.

lukka commented 6 years ago

Closing as no activity since more than 1 year. Feel free to reopen it if you believe it is useful to keep track of it, thanks.