Tuesday, October 13, 2015

Digest for comp.lang.c++@googlegroups.com - 14 updates in 5 topics

JIE SHI <jieshi.uk@gmail.com>: Oct 13 06:47AM -0700

Dear all,
 
I am new to C++ environment, I found it is very different from FORTRAN which I am familiar. When I compile the source code of a model, there is the following messages.
 
 
'VS2010.exe': Loaded 'C:\VS2010\Debug\VS2010.exe', Symbols loaded.
'VS2010.exe': Loaded 'C:\Windows\System32\ntdll.dll', Exports loaded.
'VS2010.exe': Loaded 'C:\Windows\System32\kernel32.dll', Exports loaded.
'VS2010.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Exports loaded.
'VS2010.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'VS2010.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
The program '[5668] CAS HYDRO VS2010.exe: Native' has exited with code 1 (0x1).
 
 
Followed some suggestion, I installed the Microsoft Symbol Package to solve the problem. I the one I use is Windows 7 Service Package 1, but with no luck, the error still there. Any suggestion?

 
Jie Shi
-------
Cardiff University, UK
Research Assistant
Victor Bazarov <v.bazarov@comcast.invalid>: Oct 13 10:01AM -0400

On 10/13/2015 9:47 AM, JIE SHI wrote:
> I am new to C++ environment, I found it is very different from
> FORTRAN
which I am familiar. When I compile the source code of a model, there is
the following messages.
 
> Followed some suggestion, I installed the Microsoft Symbol Package to
> solve the problem. I the one I use is Windows 7 Service Package 1,
> but with no luck, the error still there. Any suggestion?
 
The fact that your exe exits "with code 1" most likely has nothing to do
with loading of the symbols (or exports). The messages come from the
debugger. Exiting with code 1 can indicate an error or it can be
normal. You need to debug your executable. Disregard those messages
about the symbol loading for the time being.
 
V
--
I do not respond to top-posted replies, please don't ask
Christopher Pisz <nospam@notanaddress.com>: Oct 13 10:20AM -0500

On 10/13/2015 8:47 AM, JIE SHI wrote:
> -------
> Cardiff University, UK
> Research Assistant
 
Debug it. I don't see anything wrong there. The program loads, runs, and
exits with a return of 1. If you'd like to see why it is exiting with a
return of 1, you have to step through it.
 
Here's a bit about how to use your debugger:
https://msdn.microsoft.com/en-us/library/y740d9d3.aspx
 
 
 
--
I have chosen to troll filter/ignore all subthreads containing the
words: "Rick C. Hodgins", "Flibble", and "Islam"
So, I won't be able to see or respond to any such messages
---
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 13 04:15PM

On Tue, 2015-10-13, Christopher Pisz wrote:
 
>> I am new to C++ environment, I found it is very different from
>> FORTRAN which I am familiar. When I compile the source code of a
>> model, there is the following messages.
...
 
> Debug it. I don't see anything wrong there. The program loads, runs, and
> exits with a return of 1. If you'd like to see why it is exiting with a
> return of 1, you have to step through it.
 
Or just read the code. If an 'exit(1)' is executed or main() has a
'return 1', that's the behavior the author will see.
 
BTW, I suspect /that/ aspect isn't different between C++ and FORTRAN.
There's no C++ content in the questions above; just messages from
Visual Studio and a Windows program returning an exit code of 1.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Paavo Helde <myfirstname@osa.pri.ee>: Oct 13 11:39AM -0500

JIE SHI <jieshi.uk@gmail.com> wrote in
 
> Followed some suggestion, I installed the Microsoft Symbol Package to
> solve the problem. I the one I use is Windows 7 Service Package 1, but
> with no luck, the error still there. Any suggestion?
 
There is no error visible here.
 
It might be possible that you have confused the Visual Studio debug
output window with the console output window of your program. (Hint: to
see the console output start your program without debugger (Ctrl+F5) or
put a breakpoint near the end of main()).
 
hth
Paavo
Geoff <geoff@invalid.invalid>: Oct 13 04:00PM -0700

On Tue, 13 Oct 2015 06:47:18 -0700 (PDT), JIE SHI
>-------
>Cardiff University, UK
>Research Assistant
 
There is no error here, except as others have mentioned the non-zero
return value from your program which would imply there is at least one
exit(1); call in your project or a return 1; statement in the "main"
function. C and C++ programs generally return 0 on success and
non-zero for some failure.
 
The output above is from the Visual Studio IDE "Output" window that is
filled in by the debugger as it starts up and runs your program. All
the DLLs are listed as they are loaded in support of your program.
There is generally no important information in the debug output window
unless you use functions like OutputDebugString() to print information
to it.
 
The [5668] is the process ID (PID) of your program for that session.
The PID will change every time your program is executed. CAS HYDRO
seems to be the program name but the last line seems a little odd to
me as it's not what I usually see. Sample below:
 
[many dll loads snipped]
The program '[4320] sigsegv.exe: Native' has exited with code 0 (0x0).
 
I seldom need support DLL symbols nor do I debug into the library DLLs
so I don't load their symbols anymore.
 
Paavo's suggestion of ctrl-F5 to run your program in a console window
detached from the debugger is an excellent one for console mode
programs with erroneous behaviors or unexpected terminations.
 
Otherwise, to track down your error return, set breakpoints at all
exit(1) or return 1; statements and run with debugger using F5 to see
where your program is terminating.
woodbrian77@gmail.com: Oct 12 10:39PM -0700

> > is to software what the wheel was to transportation?
 
> Certainly not (although off-line code generation itself is very useful).
> The biggest issues I can see, apart from some distractions like setting on-line accounts, is the question of intellectual property. What happens to *my* IP when I upload my specifications to the on-line code generation server?
 
Hi, Maciej,
 
It's still yours. If you want your code to be removed from our
server, we'll do it.
 
There are four types of people:
One who says, "What is mine is yours, and what is yours is mine" is a boor.
One who says "What is mine is mine, and what is yours is yours" -- this is a median characteristic; others say that this is the character of a Sodomite.
One who says, "What is mine is yours, and what is yours is yours" is a chassid (pious person).
And one who says "What is mine is mine, and what is yours is mine" is wicked.
 
http://www.chabad.org/library/article_cdo/aid/2099/jewish/Chapter-Five.htm
 
I want to be a pious man and help you protect your software
and resources. Some of your software is stored on our server
in order to optimize the process. It makes it easier on your
hardware and ours and takes less bandwidth and time to
complete requests.
 
 
> Later, how can I use the generated code in my project?
 
There are examples of that in the archive that
can be downloaded here --
 
http://webEbenezer.net/build_integration.html
 
> Can I have a guarantee for service continuity for the next eleventy years? It would be a pity to find out that your service was abandoned when my project is already fully dependent on it and it needs some more code generated due to requirement changes, etc.
 
In 2002 I wrote:
 
'The "life" of a client/server application is usually ten or more
years. It is important to those developing such systems that
the tools they choose be supported for the length of their
development and maintenance.'
 
That was written to investors and not on a newsgroup.
A company is needed in my opinion to help in this area.
 
Anyway, the financial and technical state of the company
is improving. This past summer I built a new server for the
company. It has 16GB of ECC ram and other server grade
components. I'm not completely finished with it, but it is
working and I've been hosting the site on it for a few months.
 
Once we get some external users the company will get even
stronger. As far as guarantees go, if someone is willing to
pay enough money they can have that guarantee. I'm not
asking for anyone to pay for the service, but if it is important
to them that's how they could guarantee it. I hope for there to
be organic growth in the company so there's no need to guarantee
it like that.
 
> Related to service continuity is a guarantee for repeatable builds, if I choose to generate the code again, some time in the future.
 
Currently there's only one version of the service available,
but having more than one version available isn't very difficult.
If the company does well, support for older versions can be
maintained.
 
> On-line code generation is similar to on-line compilation.
 
Not really. On line code generation is a more efficient
way of generating code than what C++ compilers do today.
From what I've seen, on line compilation is a web site
front end to a compiler. Lipstick on a pig/hippo.
 
> Looks like fun in a classroom, but I would not include it in any serious project development plan. Certainly this is not a "transportation wheel" level of innovation.
 
 
Brian
Ebenezer Enterprises - "We few, we happy few, we band of brothers."
http://webEbenezer.net
scott@slp53.sl.home (Scott Lurndal): Oct 13 01:09PM


>> On-line code generation is similar to on-line compilation.=20
 
>Not really. On line code generation is a more efficient=20
>way of generating code than what C++ compilers do today. =20
 
Efficient in what sense, exactly. You should be able to
quantify any efficiency gains.
 
Offset them with the need to have access to your on-line
generation system 24x7.
woodbrian77@gmail.com: Oct 13 09:39AM -0700

On Tuesday, October 13, 2015 at 8:09:56 AM UTC-5, Scott Lurndal wrote:
> >way of generating code than what C++ compilers do today. =20
 
> Efficient in what sense, exactly. You should be able to
> quantify any efficiency gains.
 
C++ compilers are restarted for each file they compile.
If they were servers, they would compile many files between
restarts.
 
 
> Offset them with the need to have access to your on-line
> generation system 24x7.
 
Offset that with 4 million (according to Stroustrup) C++
programmers. And there are computer parts available today
that aren't as likely to break as in the past.
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
scott@slp53.sl.home (Scott Lurndal): Oct 13 05:10PM


>C++ compilers are restarted for each file they compile.
>If they were servers, they would compile many files between
>restarts.
 
So your service generates relocatable object code, then? For
which architecture? i686? ia64? x86_64? s390? armv7? armv8? mips?
powerpc?
 
Or do you just generate C++ source that the end-user compiles?
 
It seems to me that the network overhead to get to your compiler farm
would completely swamp the miniscule overhead of "restarting"
a compiler for each file being compiled - something that operating
systems are designed to do efficiently (to the extent that gcc
is part of the spec benchmark suite used by processor designers
and operating system designers to quantify system performance).
Particularly given the propensity of operating systems to cache
recently used files (read: header files) in memory.
 
 
>Offset that with 4 million (according to Stroustrup) C++
>programmers. And there are computer parts available today
>that aren't as likely to break as in the past.
 
Total non sequitur.
David Brown <david.brown@hesbynett.no>: Oct 13 11:03PM +0200


> C++ compilers are restarted for each file they compile.
> If they were servers, they would compile many files between
> restarts.
 
Your servers are /generating/ C++ code. That is a completely different
task from /compiling/ C++ code.
 
 
There are one good way to make compiling C++ code more efficient -
replace the "include file" system with pre-compiled modules. It is not
uncommon for a 200 line C++ file to require a million lines of
compilation, due to include files. Modules, with clang and MSVC having
different experimental solutions, will hopefully be standardised for C++17.
 
Rosario19 <Ros@invalid.invalid>: Oct 13 10:35AM +0200

[i add cpp News Group]
On Mon, 12 Oct 2015 20:50:00 -0400, "J. Clarke" wrote:
 
>> b=c is one error because b and c have different type definition
 
>You're aware are you not that in APL that would be a perfectly valid
>expression?
 
but that is good or it is not good?
 
the doubit is the C++ way, using types, is better because one find
error better, or in the mind is clear
m is one int it is not one double etc
is clear better what are operators
are called from types arg
 
so =operator undefinited for differents types,
if the user not define it tru cast...
[so the C++ define =operator from different types for me would be one
error because one not see conversion in the write code statement]
 
and i like types because it is clear that "m" is type unsigned int
will not be
float in the same function, and in expression operations are form int
not from double or viceversa
 
u32 function(???)
{
/*
at start of function always definition or definition-assigment
for(int i=0; i<n; ++i) etc; // is one abomination for me
that assign each name to its type that never will be changed in
in the function
*/
Strig.u8 a="1234asdfv";
float64 f, b=1.564;
Matrix[3][2].u32 c1, c={1,2,3}{4,5,6};
u32 m;
 
//a is a string
//b is a number float of 64 bit
//c is a 3x2 matrix
//So if now I write
b=c
//would be one error
 
c1=c|m=(u32)b|a+=(Strig.u8)c;
//could not be error
 
}
 
mark <mark@invalid.invalid>: Oct 13 10:08AM +0200

On 2015-10-12 21:14, Christopher Pisz wrote:
> run as a "windows service"
 
> There is already a preprocessor definition in executables being run in
> "console mode" put there by Visual Studio: _CONSOLE
 
"_CONSOLE" has nothing whatsoever to do with what you want to detect.
There are services that run as console subsystem apps as well as
services that run as gui subsystem apps.
 
Users of your library may well want to switch the subsystem they use,
independent of whether they run as service or not.
 
> I really don't want to resort to all user's of the library having to put
> their own #ifdef's around every call to my library in order to translate
> their define into a variable to be passed as a variable.
 
What's wrong with having some library config function that does that
that once?
 
I don't know what your library is trying to do, but automatically
picking up the proxy with some strange magic without offering an
override capability is generally bad.
David Brown <david.brown@hesbynett.no>: Oct 13 09:49AM +0200

On 12/10/15 16:59, mark wrote:
> You are not the first one looking for nicer ways to unpack tuples. There
> are some fairly ugly suggestions in this thread:
 
> <https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/4yWRnzX7J7Y>
 
I was thinking here about a way to get something usable /now/, rather
than for a future C++ enhancement. So I am interested in ideas to
improve the method I suggested. From the thread you posted, the idea of
using Rvalue references looks like an improvement:
 
#define autotie_2(v_, vt_, a1_, a2_) \
auto vt_ = v_; \
auto a1_&& = std::get<0>(vt_); \
auto a2_&& = std::get<1>(vt_)
 
 
 
 
But it is also interesting to think how it would be possible to improve
C++ in order to achieve effects like:
 
auto valid, res = square(x);
 
I think that to get that, or something similar such as "auto (valid,
res) = square(x);", would require making tuples first-class objects in
C++. Tuples would have to become part of the language, as they are in
Python, rather than a template in the library. I don't think that is a
change C++ is like to want to make.
 
But if C++ were to allow code like this:
 
T foo(void);
void bar(void) {
auto x;
...
x = foo();
}
 
to be treated as:
 
void bar(void) {
T x;
...
x = foo();
 
or perhaps
 
void bar(void) {
...
T x = foo();
}
 
then we would have a big step towards a good solution - and another neat
tool for other purposes:
 
void bar(void) {
auto x;
if (test) {
x = foo1();
} else {
x = foo2();
}
doSomething(x);
}
 
At the moment, code like that needs "x" to have an explicit type, or we
must use ?: rather than "if".
 
As far as I can see, the compiler has all the information it needs to
carry out these transformations, so it should be perfectly possible to
implement.
 
And this would give us:
 
auto valid, res;
std::tie(valid, res) = square(x);
 
Possibly it could be extended to:
 
std::tie(auto valid, auto res) = square(x);
 
I am not sure it would be possible to get any nicer without making
tuples part of the language.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: