NO

Author Topic: Default to Source File each time  (Read 6024 times)

buzzFizz

  • Guest
Default to Source File each time
« on: August 16, 2012, 04:11:35 PM »
Hi everyone, I just started using pelles C, was using the new devC++ before.

One of the features I liked about Dev was that I got to choose when to make a project consisting of several files. I don't seem to be able to do this in Pelles, it just defaults to be a project when I really just want one source file so i can learn C. Is there a setting to accomplish this.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Default to Source File each time
« Reply #1 on: August 16, 2012, 05:42:47 PM »
Well, it depends on "how" you are trying to learn.

In order to compile and execute your program you're trying, it needs to be a "project", even when you have only a single source file, as you need to tell the IDE/compiler, what kind of program you are trying to create.

For simple test programs, just create an "empty project" with Win32 console as the target. Takes just a second or two with the default project options...

Ralf

CommonTater

  • Guest
Re: Default to Source File each time
« Reply #2 on: August 17, 2012, 05:36:10 PM »
Hi everyone, I just started using pelles C, was using the new devC++ before.

One of the features I liked about Dev was that I got to choose when to make a project consisting of several files. I don't seem to be able to do this in Pelles, it just defaults to be a project when I really just want one source file so i can learn C. Is there a setting to accomplish this.

In addition to Ralf's comments... I would suggest you spend a bit of time in the help file.  Pelle's C has one of the best help files I've ever seen, virtually everything you need to know is in there.  ( F1 is your friend!)

In particular...
Help -> Contents -> Integrated Environment -> POIDE Integrated Environment -> Your First Project: Hello World.

Pelles C does not make assumptions about what you're trying to do... Which is a good thing :D
« Last Edit: August 17, 2012, 05:38:26 PM by CommonTater »

buzzFizz

  • Guest
Re: Default to Source File each time
« Reply #3 on: August 18, 2012, 01:25:34 PM »
Quote
In addition to Ralf's comments... I would suggest you spend a bit of time in the help file.  Pelle's C has one of the best help files I've ever seen, virtually everything you need to know is in there.  ( F1 is your friend!)

In particular...
Help -> Contents -> Integrated Environment -> POIDE Integrated Environment -> Your First Project: Hello World.

Pelles C does not make assumptions about what you're trying to do... Which is a good thing :D

Thank you both very much for your replies. I will definitely check out the help section and become a bit more familiar with Pelles. I am still disapointed though that it is mandatory to create a full project even when you want a simple hello world program. Reminds me very much of vc++ and why i stayed away from it. Cumbersome.

If you can direct me to where I can send suggestions to the developers I would gladly request that this feature be removed.

Quote
Pelles C does not make assumptions about what you're trying to do... Which is a good thing :D

Unfortunately it does...and this example illustrates that. Creating a project should be an option...not a requirement, and even if Pelles wants to have this by default there should at least be a configuration setting to select otherwise. Otherwise - especially for new comers you can just end up with unnecessary files - .obj, .rc etc. and them getting bogged down or overwhelmed with "how much" goes into creating a simple .C program.

Thanks again for your replies.

CommonTater

  • Guest
Re: Default to Source File each time
« Reply #4 on: August 18, 2012, 02:32:34 PM »
Unfortunately it does...and this example illustrates that. Creating a project should be an option...not a requirement, and even if Pelles wants to have this by default there should at least be a configuration setting to select otherwise. Otherwise - especially for new comers you can just end up with unnecessary files - .obj, .rc etc. and them getting bogged down or overwhelmed with "how much" goes into creating a simple .C program.

Be very careful that you are not merely objecting to the differences between setups... Pelles C is not Dev C++ and you shouldn't try to make into that.  It's the old error of trying to make the new thing work just like the old thing and most often what happens is that you end up breaking it.
 
You are in a new country.  Which do you think serves you best; fitting in with the local customs or trying to remake the place to your liking?
 
 
« Last Edit: August 18, 2012, 02:37:05 PM by CommonTater »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Default to Source File each time
« Reply #5 on: August 18, 2012, 10:26:36 PM »
Quote
Pelles C does not make assumptions about what you're trying to do... Which is a good thing :D
Unfortunately it does...and this example illustrates that. Creating a project should be an option...not a requirement, and even if Pelles wants to have this by default there should at least be a configuration setting to select otherwise. Otherwise - especially for new comers you can just end up with unnecessary files - .obj, .rc etc. and them getting bogged down or overwhelmed with "how much" goes into creating a simple .C program.
Sorry, but I think you do not understand the actual situation here.

The issue why you need a project is that there Pelle's C is a Windows based/oriented compiler/IDE and there is no such thing as a "simple C program". Specially considering that Pelle's C still supports Windows CE (for older smartphones) as well.
All the options that are given under the "Empty Projects" are "simple C programs" in one way or the other. You simply need to tell the IDE what you understand as a "simple C program".

And the way I described the most likely option as I assuming your intentions is just a few mouse clicks, certainly nothing cumbersome...

Ralf

CommonTater

  • Guest
Re: Default to Source File each time
« Reply #6 on: August 18, 2012, 11:14:02 PM »
Hi Ralf...

If you will forgive a blatent plug... he should try the Workspace Manager AddIn.  Create one workspace for all his smaller code, add projects to it on the fly and keep the whole thing organized nice and tidy...

There is an alternative method... he can type up a source file and save it someplace then select Project->Build at which point it will ask him to pick a project type.  It's basically the usual process, backward. 

 
« Last Edit: August 18, 2012, 11:23:07 PM by CommonTater »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Default to Source File each time
« Reply #7 on: August 19, 2012, 12:20:10 AM »
Hi Ralf...

If you will forgive a blatent plug... he should try the Workspace Manager AddIn.  Create one workspace for all his smaller code, add projects to it on the fly and keep the whole thing organized nice and tidy...

There is an alternative method... he can type up a source file and save it someplace then select Project->Build at which point it will ask him to pick a project type.  It's basically the usual process, backward.
That might be over the top for what he might need. If he really needs to save those learning programs, creating them via the "Empty projects" options is the quickest way and it keeps them IMHO nice and tidy in a known place.

It's pretty much the same way how I create the "projects" when testing those code samples posted directly here in the forum to test them before replying. It just takes mere couple of seconds, the longest time is always to come up with a unique name to save the project and the used C file. And absolutely no fuss about any .obj, .rc files as the OP complains.

And if he wants it "really simple", just create a "test" project once, with the project file and a corresponding .C file and re-use it over and over, as it will be loaded automatically each time you start the IDE.

There are a lot of different ways, all depending on how you define "simple"...

Ralf

buzzFizz

  • Guest
Re: Default to Source File each time
« Reply #8 on: August 19, 2012, 01:28:40 AM »
Say for example I'm running someone's example code and I just want to check to see why it's not running. ex: helping people out on the fourms. I don't want to have to create a new project each time..that really is cumbersome. I just want to add a source file to the IDE and let it compile, JUST that source that I'm in right then. If I want to put them under one project then fine...that should be the user's choice though.

I understand this is the way Pelles work, and to be honest for everything else it seems amazing. I just find that non-feature annoying..

as an aside, sorry for not responding earlier but I don't get emails when someone has responded to my post so...I'm sure its something I haven't enabled though.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Default to Source File each time
« Reply #9 on: August 19, 2012, 02:18:51 AM »
Say for example I'm running someone's example code and I just want to check to see why it's not running. ex: helping people out on the fourms. I don't want to have to create a new project each time..that really is cumbersome. I just want to add a source file to the IDE and let it compile, JUST that source that I'm in right then. If I want to put them under one project then fine...that should be the user's choice though.
Well, that i sthe problem, in an environment like Windows, which is a specific target for Pelle's C, you simply can't "just compile one source file", that's what I tried to tell you.

And as I mentioned, I am doing all the time just that, copy&paste of samples from forum posts in order to help out people. And if you look a little bit around, those aren't always "simple C programs" (I still have to assume you are referring to "console" programs). So you have to make some choices as how to set up the environment (compile and linker) in order to get a result, and that's what is defined per project. And honestly, the way how this works in Pelle's C isn't even remotely something that I would consider "cumbersome". Try to do the same thing in something like OpenWatcom C(++), THEN you know what cumbersome is.

It seriously isn't so as if you have spend half an hour to get started, it seriously is just 4 or 5 mouse clicks. And removing a test "project" is just as easy and quick as creating it, just delete the project folder and you're done...

Ralf

CommonTater

  • Guest
Re: Default to Source File each time
« Reply #10 on: August 19, 2012, 05:37:48 AM »
Hi again Ralf...

The thing is that in DevC++ you can just type up a file and compile it.  What buzzfizz isn't seeing is the behind the scenes defaulting that goes on... Thing is Dev only had 4 targets... 32 bit lib, 32 bit console, 32 bit gui and 32 bit dll... It looks at the entry point... main() for console, winmain() for gui, dllmain() for a dll... and invisibly creates a temporary project to compile it.  What's really happening here is that he is now seeing something that was previously hidden from him... and complaining about it. 

Like you, I keep a console project and a gui project on my system just for dumping these code samples into for testing... makes for a quick scoop and poop test of someone's code. 

But if people want to do this the best way they should zip up their projects and attach them to the message ... that way we can just unzip into a temp folder and click on the ppj file to check out their code.

CommonTater

  • Guest
Re: Default to Source File each time
« Reply #11 on: August 19, 2012, 05:41:25 AM »
Say for example I'm running someone's example code and I just want to check to see why it's not running. ex: helping people out on the fourms. I don't want to have to create a new project each time..that really is cumbersome.

It takes all of 10 or 15 seconds and as we've already explained, there are good reasons why it is as it is...
 
I seriously doubt you'll be running sample code from these forums more than once or twice a week... so all totaled you are actually complaining about less than a minute per week...
 
Quote
I just want to add a source file to the IDE and let it compile, JUST that source that I'm in right then.

If it annoys you that much, you should continue using Dev C++.
 
« Last Edit: August 19, 2012, 05:46:25 AM by CommonTater »

JohnF

  • Guest
Re: Default to Source File each time
« Reply #12 on: August 19, 2012, 08:55:40 AM »
buzzFizz,

All one needs to have is one or two projects, (console,windows) to check code. Just copy/paste or add a source file to the project.

John

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Default to Source File each time
« Reply #13 on: August 19, 2012, 09:05:58 AM »
In some cases members include full projects, so you will have the entire environment to test the code.
---
Stefan

Proud member of the UltraDefrag Development Team