Code::Blocks Forums
User forums => Help => Topic started by: thunderben on October 01, 2016, 01:52:55 pm
-
Hi all,
my conf is: Fedora 24 x86 + code::blocks 16.01
While my previous conf (fedora23-x86 + code;;blocks 12.??) worked perfectly well, since my recent update I'm not able to open any kind of file (.c, .h, .txt either).
I found nothing on the web....
Any idea to allonw me developing with this IDE ?
-
What do you mean by cannot open file?
Please post the exact steps to reproduce the problem!
-
Back on this issue.
Well by "cannot open file", I mean:
1) from menu "Files -> Open -> [select a text fle]" and then clic on "OK"
2) clic on "open" icon from Main toolbar, and then select a text file
3) from project frame (yes, I'm able to open workspace), right clic on a source file and select "open <filename>"
After one of theses operations, nothing occur. file does not show off
Please notes:
- , if I run procedure 3) and select sub menu "open with --> hex edior" , file is opening correctly as expected.
- by "text file" I mean a file generated by gedit, or vi. displayed type by command "file <filename>" is "ASCII text"
Regards
-
Files that aren't automatically handled by Code::Blocks are handled according to extension, as set up in Menu-->Settings/Environment/Environment Settings dialog
Select the "File Extension Handling" icon on the left. On the right should be a list of registered wildcards. For example, *.txt. If the file you want to open is not a standard Code::Blocks type handled internally it needs to be listed here. Use the "New" button to add the extension if it is not listed.
There are 3 options to open files:
- Launch an external program - a user-defined program will start. If adding new, you need to find the relevant program using the "External Program" /"Select Program" dialog.
- Launch the associated application - Windows opens the applications assigned for the file extension in Windows
- Open it in a Code::Blocks editor - self explanatory.
On General Settings there is a "Manage" button which opens a dialog with checkboxes to select which files are associated by extension with Code::Blocks, these should typically be project files, workspace files, source code, and header files.
See also: How to auto open files with an external program? http://forums.codeblocks.org/index.php?topic=11873.0 (http://forums.codeblocks.org/index.php?topic=11873.0)
-
what if you create new file/project?
-
First: thanks for your answers.
CJS:
It have nothing to do with file extension: even ".c" and ".h" files do not open.
Nevertheless, I followed your directives: ".c" files are set to be opened by codeblocks editor.
Plus, I changed ".txt" files association with an external editor (gedit). This operation works well, txt files are now edited with gedit while I open them from codeblocks.
BlueHazzard:
I'm able to edit created file with codeblocks just after creation. BUT, if i close them and try to re-edit them, they don't open as others files.
An intuition:
It feel like internal editor did not installed correctly.
Please note I installed codeblocks from Fedora24 repository via yum extender (graphical interface from yum)
-
An intuition:
It feel like internal editor did not installed correctly.
The editor is inseparable part form codeblocks.
I guess it is time to record a video showing us what is going on.
-
Can you start codeblocks from a console with the -v parameter (and probably the -d also) to get some debug information ?
Nevertheless, I will install Code::Blocks in a fresh F24 VM to see if I can reproduce the error.
Where are your files located by the way ?
-
An intuition:
It feel like internal editor did not installed correctly.
The editor is inseparable part form codeblocks.
I guess it is time to record a video showing us what is going on.
I have no idea what happens if the default MIME handler is turn off.
But, it might match the OP problem.
Tim S.
-
Works fine here, on a clean vm with a fresh install of C::B.
All files uptodate.
What's the output if you run in a console ?
-
An intuition:
It feel like internal editor did not installed correctly.
The editor is inseparable part form codeblocks.
I guess it is time to record a video showing us what is going on.
I have no idea what happens if the default MIME handler is turn off.
But, it might match the OP problem.
Tim S.
It shows an error message (e.g.): Could not open file /home/jens/test.txt,
because no extension handler could be found.
(just tried on F24).
*.cpp files still open flawlessly.
-
ISSUE SOLVED!
jens
1)
Your question: "Where are your files located by the way ?" remind me troubles when I developed on Windows. VisualStudio had limitation on projects files path...
My source path was: "/home/benoit/Documents/C\C++/Hello"
BacsSlash seems suspicious, so I turned it to a minus, so here my new path: "/home/benoit/Documents/C-C++/Hello".
And abracadabra, file opening works perfectly now :)
It official: C:B don't like backslashes !!!!!!!
2)
nevertheless, I ran C:B from a console with -d and -v (with faulty file path) and re-try issue.
I had no debug message on console screen, nor I found log file. Do you know where to find it (them) ?
ANYWAY
many thanks to all for your precious help
-
-v pops up a window for some special problems, -d add a "Code::Blocks debug"-tab to "Logs & others".
-
Thanks Jens.
I attached a file with a copy/paste of "code:blocks" and "code:blocks debug" tabs.
Have a nice reading ;)
-
I see the issue here too.
The problem is, that the backslash is an allowed character in Unix/Linux filenames, but space seperator in windows.
C::B converts all backslashes in filenames to "normal" forward slashes on save of the projectfile.
That can be called a bug on Linux, but I don't know if a fix is worth the work.
Using charactares, that are only allowed on one platform, lead to problems problems for cross-platform developping and a fix might introduce new bugs.
-
We should at least report this as a warning/error, so the users know what is going on.