User forums > Using Code::Blocks

Using code::blocks w/o a project

<< < (3/12) > >>

dukester:

--- Quote from: Pecan on January 27, 2024, 05:39:23 pm ---Easier than that is:
Load Codeblocks and do:
If you get messages like: "HelloWorld already exists, do you want to overwrite it?", answer yes.
1) Menu/file/new/project...
2) Double click "Project application"
3) Click on "next" two times. Enter the name "HelloWorld" (no spaces)  in the project title.
4) Click on "next" and "finished"
5) On the Project tab double click "main.cpp" to open the file.
Cl6) Cick on the compile (gear icon) to compile, then  Menu/Build/run (or the  green right-pointing run arrow).

--- End quote ---

I just tried your above suggestion for hellery! No joy!
The main.c file got written to the HelloWorld directory, BUT /obj/Release/main.o never gets written so gcc chokes with an error msg.


--- Quote ---/usr/bin/bash: gcc -Wall -O2 -Wall -std=c99 -m64 -Og  -I~/programming/c/code/HelloWorld -I~/programming/c/code/HelloWorld/ -c ~/programming/c/code/HelloWorld/main.c -o obj/Release/main.o: No such file or directory
--- End quote ---

Pecan:
What version of CodeBlocks are you using?
Should show in the splash screen, but you can find it in the Menu/Help also.

Tomorrow, I'll load up Codeblocks in a Linux VM and see what's going on.

Hang in there, bud. You're gonna like CodeBlocks.  :)

I've been using it for Windows, Linux, and embedded coding for 20 yrs. I know any new software is hard to get started using. After that, it flies.

We'll figure this out. I just need to cause the same problems you're having to understand what's going on.


dukester:
Right on! I'm close to the solution I'm sure!
I've got v20.03 on this Linux antiX box!

Thanks for all your help!

Pecan:
I brought up (in a VMware) Linux Mint 21.x:
Name             : Code::Blocks
Version          : 20.03-r11997
SDK Version      : 2.0.0
Scintilla Version: 3.7.5
Author           : The Code::Blocks Team
E-mail           : info@codeblocks.org
Website          : http://www.codeblocks.org
wxWidgets Library (wxGTK port)
Version 3.0.5 (Unicode: wchar_t, debug level: 1),
Runtime version of toolkit used is 3.24.
Compile-time GTK+ version is 3.24.33.

I disabled all plugins except: (via Menu/Plugins/Manage Plugins)

--- Code: ---Abbreviations
AutoVersioning
Autosave
BrowseTracker
Compiler
Debugger
DragScroll
Files extension handler
Foreign projects Importer
Header Fixup
Help pllugin
IncrementalSearch
Keyboard shortcuts
OccurrencesHighlighting
Open files list
ReopenEditor
Scripted wizard
SmartIndentCpp
SmartIndentXml
Source Exporter
Source code formatter
ThreadSearch
Todo List
wxSmith
sxSmith-Aui
wxSmith-Contrib Items
wxSmith-MIME plugin

--- End code ---

I restarted CB after disabling plugins.
I performed the following.
1) Menu/File/New/EmptyFile
2  copy/pasted your code into the Untiled1 editor.
3) Menu/File/Save as/ into Home/pecan/temp/HellowWorld.c
4) Menu/Build/Build
5) Menu/Build/Run

 The results are in the .jpg attached.

Build Messages

--- Code: ---||=== Build file: "no target" in "no project" (compiler: unknown) ===|
||=== Build finished: 0 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

--- End code ---

Build Log

--- Code: ----------------- Build file: "no target" in "no project" (compiler: unknown)---------------

gcc   -c /home/pecan/Temp/HelloWorld.c -o /home/pecan/Temp/HelloWorld.o
gcc  -o /home/pecan/Temp/HelloWorld /home/pecan/Temp/HelloWorld.o   
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
Checking for existence: /home/pecan/Temp/HelloWorld
Executing: 'xterm -T '/home/pecan/Temp/HelloWorld' -e '/usr/bin/cb_console_runner' '/home/pecan/Temp/HelloWorld'' (in '/home/pecan/Temp')
Set variable: LD_LIBRARY_PATH=

--- End code ---

dukester:
WOW! I'll try disabling all plugins as well except those you kept - and try again. Thanks a bunch for the trouble you went through!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version