Open onthegrid007 opened 3 months ago
This looks like a Windows build using vanilla clang.
_DllMainCRTStartup is usally via the VC runtime in my understanding, perhaps -nostartfiles
is a problem here.
How would I go about removing that flag in the compilation?
glew-cmake does not set -nostartfiles
flag.
In my assumption, It would be set in some Language-wide flags ex) CMAKE_C_FLAGS
. Please check CMakeLists.txt of RAITOEngine
or the most top CMakeLists.txt or environment variable.
I have tried everything to remove this flag, it is not me and it is not from RAITOEngine. I als tried building in release and there's an unresolved symbol to memset that comes up as well as the same error from before. I can't seem to figure out why...
I could not reproduce your error.
I can build libglew_shared with cmake 3.29, clang 11.0 & ninja 1.12 on windows. Also, I found that -nostartfiles
is not an issue.
My build log
[1/2] C:\PROGRA~1\LLVM\bin\clang.exe -DGLEW_BUILD -DGLEW_NO_GLU -DVC_EXTRALEAN -DWIN32_MEAN_AND_LEAN -D_CRT_SECURE_NO_WA
RNINGS -Dlibglew_shared_EXPORTS -IC:/Users/perlmint/Documents/glew-cmake/include -g -Xclang -gcodeview -O0 -D_DEBUG -D_D
LL -D_MT -Xclang --dependent-lib=msvcrtd -std=gnu2x -MD -MT CMakeFiles/libglew_shared.dir/src/glew.c.obj -MF CMakeFiles\
libglew_shared.dir\src\glew.c.obj.d -o CMakeFiles/libglew_shared.dir/src/glew.c.obj -c C:/Users/perlmint/Documents/glew-
cmake/src/glew.c
[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\clang.exe -nostartfiles -nostdlib -g -Xclang -gcodevi
ew -O0 -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -fuse-ld=lld-link -shared -o bin\glew-sharedd.dll -Xlinke
r /MANIFEST:EMBED -Xlinker /implib:lib\glew-sharedd.lib -Xlinker /pdb:bin\glew-sharedd.pdb -Xlinker /version:2.2 CMakeFi
les/libglew_shared.dir/src/glew.c.obj -lopengl32.lib -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut
32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."
There is only one difference with your link command. It is --dependent-lib=msvcrtd
. But, I removed it from the generated build script and tried to build, the build failed with an unrelated error.
LINK : fatal error LNK1158: cannot run 'rc.exe'
clang: error: linker command failed with exit code 1158 (use -v to see invocation)
If you are still trying this, Can you share your build environment?
Getting an error of no _DllMainCRTStartup function...
Any help would be appreciated...