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

MinGW (TDM-GCC) IntelliSense problems #888

Closed
tehKaiN opened this issue Jul 17, 2017 · 6 comments
Closed

MinGW (TDM-GCC) IntelliSense problems #888

tehKaiN opened this issue Jul 17, 2017 · 6 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service

Comments

@tehKaiN
Copy link

tehKaiN commented Jul 17, 2017

Hi there,
I'm developing using VSCode 1.14.1, ms-vscode.cpptools 0.12.0

I've problem using TDM GCC 5.1 - everything works fine except Intellisense with Boost. After including boost to my project, it's #include squiggles with intrin.h not found error. So I've switched intellisense mode to clang-x64 and now squiggles changed to termios.h. My include & browse paths look like this:

"D:/prg/kompilatory/TDM-GCC/include",
"D:/prg/kompilatory/TDM-GCC/lib/gcc/mingw32/5.1.0/include",
"D:/prg/kompilatory/TDM-GCC/lib/gcc/mingw32/5.1.0/include/c++",
"D:/prg/kompilatory/TDM-GCC/lib/gcc/mingw32/5.1.0/include/c++/mingw32",
"D:/prg/kompilatory/TDM-GCC/lib/gcc/mingw32/5.1.0/include/c++/tr1",
"D:/prg/kompilatory/TDM-GCC/include",
"D:/prg/libs/wxWidgets-3.0.3/include",
"D:/prg/libs/wxWidgets-3.0.3/lib/gcc_lib/mswu",
"D:/prg/libs/boost_1_64_0"

Problems disappear if I don't use boost, but I guess that's not really a solution. ;)

@sean-mcmanus sean-mcmanus added the more info needed The issue report is not actionable in its current state label Jul 17, 2017
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jul 17, 2017

Can you locate the missing file and add the path to it? From what I read online, MinGW doesn't have termios.h. Maybe you can add a path to a dummy termios.h file as a workaround.

@bobbrow
Copy link
Member

bobbrow commented Jul 17, 2017

If the file doesn't exist, the issue is most likely due to a missing "define" sending IntelliSense down the wrong path during compilation. I haven't had a chance to look into this issue yet, but will soon.

BTW, clang-x64 mode is what you want if you're using MinGW.

@bobbrow
Copy link
Member

bobbrow commented Jul 17, 2017

(Oh, and if you could provide a source code snippet that would be nice so I can see which Boost headers are giving you trouble)

@tehKaiN
Copy link
Author

tehKaiN commented Jul 25, 2017

Ok, so it goes like this:
In my soruce code I have:

#include <wx/wx.h>
#include <boost/asio.hpp> // squiggles with netdb.h

In asio.hpp:

#include <boost/asio/basic_datagram_socket.hpp> // squiggles with netdb.h
#include <boost/asio/basic_deadline_timer.hpp>
#include <boost/asio/basic_io_object.hpp>
#include <boost/asio/basic_raw_socket.hpp>
#include <boost/asio/basic_seq_packet_socket.hpp>
#include <boost/asio/basic_serial_port.hpp> // squiggles with termios.h

netdb.h: basic_datagram_socket.hpp -> basic_socket.hpp -> basic_io_object.hpp -> io_service.hpp:

#if defined(BOOST_ASIO_HAS_IOCP)
# include <boost/asio/detail/win_iocp_io_service.hpp>
#else
# include <boost/asio/detail/task_io_service.hpp> // squiggles changed to task_io_service, I guess it should've gone IOCP way since it's win32.
#endif

And there in task_io_service.hpp squiggles are gone, wtf.

Let's go with termios:

basic_serial_port.hpp -> serial_port_base.hpp and there squiggles disappear.

@bobbrow bobbrow added the bug label Jul 28, 2017
@bobbrow
Copy link
Member

bobbrow commented Jul 28, 2017

Thanks for the additional information. I can reproduce the missing squiggles when you open the header files. There is something strange going on when you open certain of these boost headers which results in starving the processing of our input queue which basically disables our extension. I'm investigating.

@bobbrow
Copy link
Member

bobbrow commented Jul 29, 2017

Adding "_WIN32" to the "defines" array in c_cpp_properties.json resolved the squiggles for me. I haven't tested enough to see if that causes other issues with MinGW, but in the code files I tried it didn't introduce any new problems. It looks like Boost might also want you to set "__MINGW32__" as well but it didn't make any difference in this particular case.

I have another fix for the input queue starving as well.

@bobbrow bobbrow added fixed Check the Milestone for the release in which the fix is or will be available. and removed more info needed The issue report is not actionable in its current state labels Jul 31, 2017
@bobbrow bobbrow closed this as completed Sep 5, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

3 participants