0

I'm a first-year university student currently using Visual Studio for C++ programming. My new lecturer uses QT Creator but I don't know how to import the files for use in Visual Studio. I installed QT Visual Tools with the hope that it will help me but the vcproj file it produces is just giving me errors (I'm using the latest version and my VS Community version is up to date as well). If anyone can help I would greatly appreciate it.

Errors:

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(20,5): error C2065: 'uint': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(20,10): error C2146: syntax error: missing ';' before identifier 'n'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(20,10): error C2065: 'n': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,9): error C2065: 'uint': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,14): error C2146: syntax error: missing ';' before identifier 'i'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,16): error C2143: syntax error: missing ';' before '='

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,16): error C2143: syntax error: missing ')' before '='

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,16): error C2059: syntax error: '='

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,21): error C2065: 'i': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,30): error C2065: 'i': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(23,31): error C2059: syntax error: ')'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(24,18): error C2065: 'i': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(24,32): error C2065: 'i': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(24,36): error C2059: syntax error: ';'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(27,1): error C2059: syntax error: '}'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\important_functions.cpp(27,1): error C2143: syntax error: missing ';' before '}'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,13): error C2065: 'uint': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,18): error C2146: syntax error: missing ';' before identifier 'i'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,20): error C2143: syntax error: missing ';' before '='

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,20): error C2143: syntax error: missing ')' before '='

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,20): error C2059: syntax error: '='

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,25): error C2065: 'i': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,44): error C2065: 'i': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(34,45): error C2059: syntax error: ')'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(35,13): error C2059: syntax error: 'do'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(35,13): error C2143: syntax error: missing ';' before '{'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(35,13): error C2065: 'i': undeclared identifier

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(38,5): error C2059: syntax error: 'if'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(38,51): error C2143: syntax error: missing ';' before '{'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(38,51): error C2447: '{': missing function header (old-style formal list?)

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(46,1): error C2059: syntax error: '}'

1>C:\Users\N\OneDrive\Documents\C++ projects\COMS 1017\lab1-2020\myTests\tests.cpp(46,1): error C2143: syntax error: missing ';' before '}'

Panwen Wang
  • 3,573
  • 1
  • 18
  • 39
Laze
  • 1
  • 1
  • You could use the Qt Visual Studiio addon – drescherjm Jul 28 '20 at 18:34
  • Recreate the project files as CMake, which Visual Studio supports natively. CMake's Qt support is top-notch. – Botje Jul 28 '20 at 18:35
  • ***the vcproj file it produces is just giving me errors*** That may be fixable but no one can help fix errors they can't see. – drescherjm Jul 28 '20 at 18:35
  • Those errors don't appear to be caused by the pro file. I think they can be fixed in the code. – drescherjm Jul 28 '20 at 18:48
  • ***'uint': undeclared identifier*** [https://stackoverflow.com/a/3552116/487892](https://stackoverflow.com/a/3552116/487892) – drescherjm Jul 28 '20 at 18:50
  • @drescherjm thanks I tried to fix that error by adding this to the cpp file but now i'm getting 3 errors about unresolved externals #ifndef uint #define uint unsigned int #endif – Laze Jul 28 '20 at 21:07
  • You may want to use `using uint = unsigned int;` instead of the `#ifndef uint #define uint unsigned int #endif `. As for the unresolved externals you probably have to show code or consult this question: [https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – drescherjm Jul 28 '20 at 21:09
  • @drescherjm thanks for the help. I asked my lecturer about it and he said I should just make a new project and manually add in each source file and header file without worrying about the pro file. After I used the definition with the hashtags it worked but thanks for bringing the unsigned int error to my attention. Will definitely remember the **uint = unsigned int** thing – Laze Jul 31 '20 at 13:58

0 Answers0