C & C++

Learning Codebench

Hi, I'm trying to learn Codebench. It's going okay, I think. I jumped into the deep end and I'm working on a project that has eighteen source files and it least that many headers. I'm moving it over from Cubic IDE. Many of the files have errors, but everytime it compiles. it does every file, errors and all, before stopping. It takes a minute or two. I'm wondering if there is a way to get it to stop compiling after the first error to save time. Also, is there a way to get it to stop displaying routine messages like the ones about deprecated functions?

Forums: 

Formatting a float using snprintf()

I'm trying to produce a formatted string that shows the length of an audio sample. The format I want is HH:MM:SS.MS, where SS.MS is a float containing seconds and (after the decimal point) milliseconds.

For example "00:23:22.54" (23 minutes, 22 seconds and 54 milliseconds).

I'm using snprintf() from newlib, the call is this:

Forums: 

error: 'ABC' is not a member of ‘std’

Hi, i9 get whne crosscompiling c++ software (ZGloom):
...
hud.cpp:373:15: error: ‘to_string’ is not a member of ‘std’
pos += std::to_string(player.x.GetInt());
...

and with std::atoi, std::stoi too.

How can I "enable"/add std:: methods/functions?

1)Looking on internet I can change "to_string" to use a selfmade method/function.

2)Adding -std=c++11 doesn't solve anything.

TiA

Forums: 

Locale aware date formatting and strftime()

The strftime() documentation says that formatting strings such as "%x" should follow the date formatting for the current locale. However, in my tests it always prints the date in US format mm/dd/yy. Using setlocale() does nothing, and locale prefs are ignored.

Does AmigaOS have a standard way of always getting the date formatting used by the current locale? Locale.library's FormatDate() still requires you to manually choose the date format, so that's not the answer. Is there a way to get a date format string for the user's locale choice?

Forums: 

X1000 CFE SDK?

Hello. Did anyone make a CFE SDK?

People can certainly compile for it. Well Linux images anyway.

I'm interested if there is a basic CFE SDK so we can can compile simple programs like "Hello CFE World" and run them in CFE.

There are sources for compiling UBoot apps so it would be good if CFE apps can be compiled the same way.

Forums: 

Find default app

Let's say I have an LhA archive, how to I find out the path to the default archive program (Sys:C/Unarc)? File does not have an icon associated with it. Same for any file type: PNG, MP3, JPG, etc.

Is there a place in the OS to look it up with system functions? Or do I have to look at the ENVARC:Sys/def_XXX.info to get it?

Forums: 

Passing a variable to function by reference [Solved]

I try to pass a variable by reference to a function and change its value. Inside that function it works but when I print the value of the variable outside the function the value is different.. I'd like to understand what I am doing wrong as I need it for my program..

I declare this variable as global plus the definition of two functions outside (before) the main function:

Forums: 

Pages

Subscribe to RSS - C & C++