News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

compiling fine on command line, having issues with codeblocks settings

Started by Dracunos, September 25, 2018, 05:47:06 AM

Previous topic - Next topic

Dracunos


Hello, I'm having a weird issue with the pdcurses library.. My code is good, it works, it compiles, it runs on multiple pcs.. I only use codeblocks on my laptop, and while I can compile just fine through the command line on my laptop, it is giving me undefined references to the pdcurses library I used when I compile via codeblocks.

Basically, I need help making sure codeblocks is doing exactly the same thing that is working perfectly fine in my terminal. The exact working command I run in the command line is:

G:\mingw\bin\mingw32-g++ main.cpp output.cpp entities.cpp input.cpp components.cpp gameInit.cpp startMenu.cpp inputOutput.cpp -lpdcurses -std=c++11

I made sure that the global compiler settings for the selected compiler had base directory set to g:\mingw, and that the toolchain executables were there.. Specifically I have mingw32-g++.exe selected for my c++ compiler. I re-created the whole project after that just in case.

In the project build options I unchecked every box in compiler flags except std=c++11. I added '-lpdcurses' to the 'other compiler options' tab. I made sure every single other tab and sub-tab in that whole menu was empty. I did this for the project root, and for debug, which is my build target.

I made sure every cpp and h file was in my build target files.


To get it to compile via command line, I had to have libstdc++-6.dll (from G:\mingw\bin) in the working directory. It also needed that file in the working directory to run properly. Without that I was getting linker errors, presumably because there's another version of a libstdc++-6.dll in my path somewhere.

In case it was a system path issue, I've temporarily moved the G:\mingw\bin directory to the very front of my path, but no change.


Thank you for your time and assistance.


sodev


Dracunos

Quote from: sodev on September 25, 2018, 08:55:23 AM
-lpdcurses has to be a linker option, not a compiler option.


Thank you very much for your help, it works great now.

'I could have sworn I tried that' is the classic newbie excuse I'll use on this one, sorry.

And I'm sorry I didn't notice the rule about posting the build log, I will remember that for future issues.