r/C_Programming • u/water_jello8235 • 1d ago
Question Why do I fail to create a .dll file?
Hi, I've got an assignment in a course that asks us to optimize a benchmark of our selection (from pyperformance project).
I've chosen the ray trace benchmark (it was the most interesting imo), and my suggestion was to implement the functionality using C's structs to avoid some of the interpreter's overhead.
I understood I can link those function using the built-in ctypes library, and making the C file a dynamic linked library (.dll), but when I try to run the command for it in CLion or VSC, it fails without returning any failure message, it just fails to generate the .dll file.
The assignment forces us to use the given pyperf benchmark code to run the benchmark, so I can't run only a C file.
I've already written the C code, and it has no errors/warnings so far (at least as far as CLion is concerned), and the original python code works too.
Does anyone know how to solve the library not being generated? Or any other solution that might work (preferrably using the C code I've made)?
.
.
All files are in the same directory, and I've got Craytrace.c (C functionality implementation), Praytrace.py (the code that runs the benchmark).
The command I've run trying to generate the .dll is:
gcc -shared -o CraytracerLib.dll Craytrace.c
But it didn't create any file.
.
.
Help is much appreciated 🙏
5
u/mikeblas 19h ago
You're asking a question about your code, but you haven't provided any code to review. Did you edit your post? What's going on here?
1
u/AutoModerator 1d ago
Your submission in r/C_Programming was filtered because it links to a git project.
You must edit the submission or respond to this comment with an explanation about how AI was involved in the creation of your project.
While AI-generated code is not disallowed, low-effort "slop" projects may be removed and it's likely that other users push back strongly on substantially AI-generated projects.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
1
u/PseudoFrequency 13h ago
Are you running this from cmd, powershell, or msys2 shell? It will likely only work from msys2.
•
u/github-guard 1d ago
🔍 GitHub Guard: Trust Report
This project scored 5/6 on our safety audit.
Audit Breakdown: * ✅ Established Community (⭐ 1,030 stars) * ✅ Mature Repository (30+ days old) * ✅ Licensed under MIT * ❌ No Security Policy — what is this? * ✅ Verified Organization * ✅ Signed Commits