Author Topic: codelocks environment settings to match command line compile statement  (Read 12144 times)

Offline philcal

  • Single posting newcomer
  • *
  • Posts: 8
G'Day Sheepish newbie here -usually I like to contribute something first before asking for help

I'm trying to compile simuino source downloaded from web. Following their instructions I compile successfully using plain vanilla (ie no makefile) command line  "g++ -o simuino simuino.c -lncurses" on a linux box. However I cannot do same within a codeblocks project that I set up. I believe code is OK and it is the codeblocks environment which needs tweaking.

First thing to note is the code is .c source but it does contain some c++ stuff?!  I read a post that you need to match extension with code type. I have attempted to force a cpp compile  by renaming to .cpp or creating  another "new" compiler I called G++GCC which is same as gcc but deleting the gcc toolchain component etc.  Eventually I got rid of alternating errors such as can't find malloc  (needs gcc?) or iostream (needs g++). New "missing/cant find  ..." errors suggested a  sequencing issue so I then played with the source file properties dialogs to attempt to get the compile sequence right- but with no success.

Can anybody suggest what might need tweaking to replicate what the command line already seems to achieve as is?  I haven't posted the project cbp since the solution hopefully is a generic one. I trust this request will not be seen as programing related but apologise if it is.

Thanks

PhilC

As an aside by way of intro I have successfully programed avr using codeblocks and avrdude but the I find the debugging cumbersome using print statements since I don't have any "in circuit" gdb hardware. Since most of my code is more logical with reduced hardware interface traffic  my goal is to debug the logic on the pc box first. Perhaps with the simuiuno simulator or  more simply initially just dummy function calls to the hardware side. I am hoping to adapt simuino source to do this. I have also looked at simulavr but this appears too heavy for me.




Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Turn on full Compiling Log; it should help to locate the problem cause.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline philcal

  • Single posting newcomer
  • *
  • Posts: 8
Thanks for quick reply Tim.

Re the log advice -I was unaware of the two extra  tabs in compiler settings; the config dialog opened not in full screen mode so I only saw  4 of 6 tabs displayed. Full functionality of the tab direction buttons went unnoticed by me.

I've discovered part of the problem.  I didn't include the lncurses library in the options tab (-lncurses on the command line) . This got me a lot further but now getting other  ncurses errors which I'll probably not pursue further. I didn't even want this functionality but was keen on getting it all complied as supplied  then whittling away the stuff I didnt actually want.