-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Not having a main() function causes a crash on Windows #111
Comments
ThomasWilshaw
added a commit
to ThomasWilshaw/CTL
that referenced
this issue
Jan 4, 2023
* fix module main function finding on Windows * add improved error handling when correct function name cannot be found
Can you try adding a test for this so it could be run with Ctest ? I think you just need to add something like this to \CTL\unittest\ctlrender\CMakeLists.txt
and then add the CTL file |
michaeldsmith
added a commit
that referenced
this issue
Jan 6, 2023
* fix ctlrender's main function finding function on Windows, fixes #111 * check for both forward and backslash in win32 * add test using functionname_is_filename.ctl * add improved error handling when correct function name cannot be found * add a test that checks ctlrender fails when a ctl module does not contain a function name that is either main or the same as the module name * add incorrect_function_name.ctl Co-authored-by: michaeldsmith <37905569+michaeldsmith@users.noreply.github.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
According to the CTL spec. all CTL files must contain either a
main()
function or a function with the same name as the source file. However in Windows only themain()
function approach works as the way this is implemented inctlrender
is whatever is after the last/
in the file path of the ctl file is looked for as a function name. This breaks on Windows as Windows uses\
rather than/
. This is even mentioned in a comment intransform.cc
.My proposed solution is to use
#ifdef WIN32
to look for backslashes rather than forward slashes intransform.cc:346
. I'll also have a look at adding a test for this but I'm not sure how far I'll get with that as I've never used this test suite before.The text was updated successfully, but these errors were encountered: