Skip to content

Commit 95e04d1

Browse files
msmolensmrbean-bremen
authored andcommitted
fix: Resolve link error in PythonQtTestMain on Windows
This changes the type of the `argv` parameter in the `main` function to match the expected signature for integration with the CMake testing framework. By default, the test driver expects the main function to have the following signature: ``` typedef int (*MainFuncPointer)(int, char* []); ``` See https://github.com/Kitware/CMake/blob/master/Templates/TestDriver.cxx.in This fixes a link error when building PythonQtCppTests on Windows: ``` 1>PythonQtCppTests.obj : error LNK2001: unresolved external symbol "int __cdecl tests_PythonQtTestMain(int,char * * const)" (?tests_PythonQtTestMain@@YAHHQEAPEAD@Z) 1>C:\temp\PythonQt-build\Debug\PythonQtCppTests.exe : fatal error LNK1120: 1 unresolved externals ``` (cherry picked from commit commontk/PythonQt@aa1a16f)
1 parent f1b466b commit 95e04d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/PythonQtTestMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
#include <QApplication>
4747

48-
int main( int argc, char **argv )
48+
int main(int argc, char *argv[])
4949
{
5050
QApplication qapp(argc, argv);
5151

0 commit comments

Comments
 (0)