User forums > Help

Extra g++ command breaking my compiles?


 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))

--- End code ---

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?

may be a typo : -lptherad or -lpthread ?

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.


[0] Message Index

Go to full version