Author Topic: Extra g++ command breaking my compiles?  (Read 1964 times)

Offline elganif

  • Single posting newcomer
  • *
  • Posts: 3
Extra g++ command breaking my compiles?
« on: July 17, 2021, 03:39:03 am »
 I have a very simple program I got from the One Lone Coder project and while it works outside CodeBlocks, it doesnt compile inside the IDE.

 my build log:
 
Code
-------------- Clean: Debug in OLC PGE testing (compiler: GNU GCC Compiler)---------------

Cleaned "OLC PGE testing - Debug"

-------------- Build: Debug in OLC PGE testing (compiler: GNU GCC Compiler)---------------

g++  -o "bin/Debug/OLC PGE testing" "/media/elganif/Data Storage/Programming Projects/OLC PGE Testing/OLC PGE testing/main.cpp" -lX11 -lstdc++fs -std=c++17 -lpng -lptherad -lGL -g -lX11 -lstdc++fs -std=c++17 -lpng -lptherad -lGL 
g++  -o "bin/Debug/OLC PGE testing" obj/Debug/main.o   
/usr/bin/ld: cannot find -lptherad
/usr/bin/ld: cannot find -lptherad
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
3 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 

So theres the first g++ command that works in console just fine but then theres a second one that shouldn't be there, has none of the needed arguments and errors out. I cant find how to turn that off. I compiled it and ran it in terminal just fine so the code works, and the g++ command works, but CodeBlocks is doing something different that breaks what I have. (and yes im aware of .cpp.o files and 2 stage compiling processes for when you have multi million line projects spanning hundreds or thousands of files but that's not what i'm doing here)

Since I have not made any changes to this code and I know it works on my system in terminal changing the code is beyond the scope of getting this IDE working for my needs.
How do I tell Code Blocks to only run the proper command and then stop?

Offline gd_on

  • Lives here!
  • ****
  • Posts: 675
Re: Extra g++ command breaking my compiles?
« Reply #1 on: July 17, 2021, 09:49:10 am »
may be a typo : -lptherad or -lpthread ?
Windows 10 64 bits (21H2), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 11.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline elganif

  • Single posting newcomer
  • *
  • Posts: 3
Re: Extra g++ command breaking my compiles?
« Reply #2 on: July 17, 2021, 07:33:52 pm »
Well that is the problem, thanks for spotting that. I made the correction, Now I just need to figure out my new issue with my misspelled tag being stuck in the arguments list even when every argument is turned off. nevermind, it 'fixed itself' after a few restarts of Code blocks (first 3, including remaking my project didnt do it, but the 4th did?). Why changes not reacting directly to my click of OK in the options menu seems very 'bug like' but if it works I can move on.
« Last Edit: July 17, 2021, 07:39:54 pm by elganif »