Wikipedia:Reference desk/Archives/Computing/2023 November 14

= November 14 =

Any C++ programmers here? Trying to build GUI like Java's JOptionPane.
I downloaded eclipse, and find out there is no C++ equivalent of Java's JOptionPane without downloading other libraries, such as Qt Creator.

I'm trying code that has


 * 1) include 
 * 2) include 
 * 3) include 
 * 4) include 
 * 5) include 

and get build error:

g++ "-IC:\Qt\6.6.0\mingw_64\include" -O0 -g3 -Wall -c -fmessage-length=0 -o WritingApp.o "..\WritingApp.cpp" ..\WritingApp.cpp:1:10: fatal error: QCoreApplication: No such file or directory 1 | #include  |

then tried


 * 1) include 
 * 2) include 
 * 3) include 
 * 4) include 
 * 5) include 

and got the build error

g++ "-IC:\Qt\6.6.0\mingw_64\include" -O0 -g3 -Wall -c -fmessage-length=0 -o WritingApp.o "..\WritingApp.cpp" g++ -L-LC:/Qt/6.6.0/mingw_64/lib -mwindows -o WritingApp.exe WritingApp.o -lg++ -o WritingApp.exe WritingApp.o C:/Qt/6.6.0/mingw_64/lib QtWidgets QtGui QtQml QtNetwork QtCore C:\Users\lonel\Downloads\w64devkit-1.20.0\w64devkit\bin/ld.exe: cannot find C:/Qt/6.6.0/mingw_64/lib: Permission denied C:\Users\lonel\Downloads\w64devkit-1.20.0\w64devkit\bin/ld.exe: cannot find QtWidgets: No such file or directory

170.76.231.162 (talk) 17:03, 14 November 2023 (UTC).


 * It looks like your program isn't properly linked. Did you correctly install Qt? I think g++ didn't find the Qt library files, probably because Eclipse build isn't providing the correct installation directory for the Qt package. Check the Eclipse C++ docs to see in which directories it looks for header files, and make sure the Qt files are in one of those.
 * Also, you might want to try running Eclipse as administrator, because it says something about permission denied, which might mean g++ doesn't have the necessary permissions to access the header files you included. Good luck!   18:28, 14 November 2023 (UTC)
 * When I right click my project, select Properties > C/C++ Build > Settings > Tool Settings > MinGW C++ Linker > what should I have in the -l and -L fields?


 * For -l, I have


 * g++ -o WritingApp.exe WritingApp.o C:/Qt/6.6.0/mingw_64/lib QtWidgets QtGui QtQml QtNetwork QtCore


 * And for +L, I have


 * -LC:/Qt/6.6.0/mingw_64/lib 170.76.231.162 (talk) 18:23, 15 November 2023 (UTC).

IP range to subnet tool
Before I start reinventing the wheel, is there a command line tool (preferably open source) that will accept two IP addresses (either as arguments or from stdin I'm not picky there) and produce to stdout one or more IP/mask values that cover the range? e.g. if given say, "127.0.0.0" and "127.0.255.255", will output "127.0.0.0/16". 72.80.78.150 (talk) 23:19, 14 November 2023 (UTC)
 * ipcalc will do that. I don't know which OS you're using but I think ipcalc runs on both Windows and Linux. CodeTalker (talk) 00:39, 15 November 2023 (UTC)
 * Exactly what I was looking for, thanks! 72.80.78.150 (talk) 02:08, 15 November 2023 (UTC)