#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0

    Question Problems Compiling


    I can compile my objects fine (unless I try MinGW64) but the executable won't compile, here's an edited version of my output:
    Code:
    "O:\Data\C_Playground\lake\build.bat" (in directory: O:\Data\C_Playground\lake)
    ...
    O:\Data\C_Playground\lake>set FLAGS=-Wall -mconsole -mwindows -mwin32 -D _WIN32
    Compiling Lake Object
    O:\Data\C_Playground\lake>mingw32-gcc -Wall -mconsole -mwindows -mwin32 -D _WIN32 -o ".\obj32\lake.c.o" -c .\lake.c
    Compiling Lua Objects
    O:\Data\C_Playground\lake>mingw32-gcc -Wall -mconsole -mwindows -mwin32 -D _WIN32 -o ".\obj32\lua\ldblib.c.o" -c "O:\Common\lua-5.3.5\src\ldblib.c"
    ...
    Compiling Lake Executable
    O:\Data\C_Playground\lake>mingw32-gcc -Wall -mconsole -mwindows -mwin32 -D _WIN32 -fPIC -o "O:\Common\lake32\lake32.exe"  ...
    collect2.exe: error: ld returned 5 exit status
    PATH=O:\Common\MinGW\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;A:\Tools\WinSDK\10\Windows Performance Toolkit\;C:\Users\awsde_000\AppData\Local\Microsoft\WindowsApps;
    CPATH=O:\Common\MinGW\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;A:\Tools\WinSDK\10\Windows Performance Toolkit\;C:\Users\awsde_000\AppData\Local\Microsoft\WindowsApps;
    LIBRARY_PATH=O:\Common\MinGW
    O:\Data\C_Playground\lake>exit
    Compilation failed.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0
    Just noticed I didn't echo the right variable at CPATH, here's the actual content after correcting the line:
    Code:
    CPATH=O:\Common\lua-5.3.5\src;O:\Common\MinGW\include;O:\Common\MinGW\include\freetype
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0
    Well managed to extract some info out of the linker:
    Code:
    collect2 version 8.2.0
    o:/common/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe -plugin o:/common/mingw/bin/../libexec/gcc/mingw32/8.2.0/liblto_plugin-0.dll -plugin-opt=o:/common/mingw/bin/../libexec/gcc/mingw32/8.2.0/lto-wrapper.exe -plugin-opt=-fresolution=O:\Temp\cc0daTXY.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lgdi32 -plugin-opt=-pass-through=-lcomdlg32 -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt --subsystem windows --subsystem console -Bdynamic -o O:\Common\lake32\lake32.exe o:/common/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../crt2.o o:/common/mingw/bin/../lib/gcc/mingw32/8.2.0/crtbegin.o -Lo:/common/mingw/bin/../lib/gcc/mingw32/8.2.0 -Lo:/common/mingw/bin/../lib/gcc -LO:/Common/MinGW -Lo:/common/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/lib -Lo:/common/mingw/bin/../lib/gcc/mingw32/8.2.0/../../.. -v .\obj32\lake.c.o .\obj32\lua\lbitlib.c.o .\obj32\lua\lauxlib.c.o .\obj32\lua\lcode.c.o .\obj32\lua\lapi.c.o .\obj32\lua\ldblib.c.o .\obj32\lua\liolib.c.o .\obj32\lua\llex.c.o .\obj32\lua\lparser.c.o .\obj32\lua\lobject.c.o .\obj32\lua\ldebug.c.o .\obj32\lua\ldo.c.o .\obj32\lua\lcorolib.c.o .\obj32\lua\luac.c.o .\obj32\lua\lgc.c.o .\obj32\lua\lstate.c.o .\obj32\lua\lundump.c.o .\obj32\lua\lmathlib.c.o .\obj32\lua\ltablib.c.o .\obj32\lua\ltm.c.o .\obj32\lua\lfunc.c.o .\obj32\lua\lstrlib.c.o .\obj32\lua\lopcodes.c.o .\obj32\lua\lutf8lib.c.o .\obj32\lua\loslib.c.o .\obj32\lua\lvm.c.o .\obj32\lua\loadlib.c.o .\obj32\lua\lmem.c.o .\obj32\lua\lua.c.o .\obj32\lua\ltable.c.o .\obj32\lua\ldump.c.o .\obj32\lua\lzio.c.o .\obj32\lua\lctype.c.o .\obj32\lua\lstring.c.o .\obj32\lua\linit.c.o .\obj32\lua\lbaselib.c.o -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt o:/common/mingw/bin/../lib/gcc/mingw32/8.2.0/crtend.o
    While googling I found a thread mentioning there is no instance of ld.exe calling exit(5); but windows lists it as access denied so I'm gonna delete my lake64 folder and see if that restores my sanity
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0
    Nope, still no luck
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0
    Tried the same build.bat on a empty c file (bar int main() { return 0; }) and still same error so definitly not the code
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0
    I just tried a recursive removale of read-only attribute from root folder (O:\Common) to see if that would fix it but again to no avail
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0
    Okay so the executable is actually compiled buuuut... the program won't start (I added a simple puts statement before the return and ran via command line), just comes out with access denied, gonna re-lookup the minimum settings for mingw to compile an executable.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    14
    Rep Power
    0
    didn't solve the root of the problem but replaced my mingw library with the nuwen variant, problem went away at that point

IMN logo majestic logo threadwatch logo seochat tools logo