I used VS Linux C ++ development support to create a Linux C ++ project, and then connect Ubuntu remote debugging on Virtualbox. But the console has printed some error messages.
How to make VS2017 correctly print the output of Linux C ++ program?
Environment
- Windows 10 Pro x64
- Microsoft Visual Studio Community 2017 15.3.3 - VS Linux C ++ development support
- Virtualbox 5.1.26
- Ubuntu 16.04 LTS x64
Step
- Shift + Ctrl + N
- Create a new Linux project
- ConsoleApplication
- Run
- Fill out SSH username and password (Ubuntu 16.04 Virtualbox)
main.cpp
#include <cstdio>
int main()
{
printf("hello from ConsoleApplication1!\n");
return 0;
}
Console
=thread-group-added,id="i1"
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
Loaded 'shared libraries loaded at this time.'. Cannot find or open the symbol file.
Stopped due to shared library event:
Inferior loaded /lib/x86_64-linux-gnu/libc.so.6
/lib64/ld-linux-x86-64.so.2
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Cannot find or open the symbol file.
Loaded '/lib64/ld-linux-x86-64.so.2'. Cannot find or open the symbol file.
[Inferior 1 (process 14481) exited normally]
程序“”已退出,返回值为 0 (0x0)。