How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Ingo U Your Own Question

Ingo U
Ingo U, Software Engineer
Category: Homework
Satisfied Customers: 476
Experience:  Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
Type Your Homework Question Here...
Ingo U is online now
A new question is answered every 9 seconds

I need a C++ memory management simulation program to compile

Customer Question

Attachment: 2013-08-11_195143_lab4.zip

I need a C++ memory management simulation program to compile and run. Included in the solution zip file is a makefile but I can't get it to run with microsoft visual studio 2010. I think the expert needs to be very familiar with microsoft visual C++ and makefiles.

 

I need the solution asap.

Submitted: 11 months ago.
Category: Homework
Expert:  Angela--Mod replied 11 months ago.

Hello, I'm a moderator for this topic. I've been working hard to find a professional to assist you right away, but sometimes finding the right professional can take a little longer than expected.

I wonder whether you're ok with continuing to wait for an answer. Please let me know and I will assist further. Thank you!

 

Best,

 

Angela

Customer: replied 11 months ago.

Hi Angela,


 


Yes that's fine.


 


 

Expert:  Angela--Mod replied 11 months ago.
Thank you for your patience while we continue to search for a professional to assist you.
Expert:  Ingo U replied 11 months ago.
Hi,
I'm currently taking a look at your files and will get back to you asap.
Regards,
Ingo U
Customer: replied 11 months ago.

ok,


 


Don't hesitate to ask for any clarifications.


 


R/


 


Mark

Expert:  Ingo U replied 11 months ago.
Well, I got it to compile and run, except it throws this assertion:


Do you get the same behavior? Also, it seemed to run OK using g++/cygwin.
Customer: replied 11 months ago.

Ingo,


 


I can't view the full image of the assertion error. Can you send it as an attachment?


 


But I did get an assertion error and didn't know what it meant or how to deal with it.


 


Mark

Customer: replied 11 months ago.

I see the assertion error message now and I got the same.


 

Expert:  Ingo U replied 11 months ago.
OK, I did a little searching and found this:

http://thisthread.blogspot.com/2013/02/when-iterator-is-not-dereferencable.html

Sounds like there's a bug in the code somewhere that g++ doesn't care about. VC++ tends to be more pedantic about such things when in debug mode.
You have at least 2 options:
- Find the bug that's trying to access a bogus iterator (hard)
- Switch the project to Release configuration (easy). I tried that and it produced similar looking output as the g++ version.

Cheers,
Ingo
Customer: replied 11 months ago.

Ingo,


 


I changed to release configuration and it compiled and ran but I did not get any output. Did you use the makefile?

Expert:  Ingo U replied 11 months ago.
Yes you did get output, you're just too slow to see it Wink.
In VC++, the console window goes away as soon as the program exits.
Once again you have 2 options:
- Run the program without debugging (Ctrl-F5) - it'll keep the output window open until you press a key
- Add the line
system("pause");
as the second to last line in your main() (right before return EXIT_SUCCESS;) - it'll have the same effect but you can set breakpoints and step through code etc.

Ingo
Customer: replied 11 months ago.

ok,


 


Got the correct output. But how do you run the makefile??

Expert:  Ingo U replied 11 months ago.
The makefile isn't used when you're working with Visual Studio - it essentially has its own built in.
Perhaps I'm misunderstanding the problem you're trying to solve. It looked like you were given some code and a makefile that probably came from a unix environment, and had to get it o run using Visual Studio. Is there more to it than that?
Customer: replied 11 months ago.

I wasn't aware makefile can't be used with visual studio. Thanks.


I got correct output using cygwin/g++.


How do you get the same output using the Makefile and the cygwin command line inteface?


 


I"m assuming the Makefile is coded correctly.

Expert:  Ingo U replied 11 months ago.
Well cygwin is a collection of many standard unix applications that can run under windows, like the shells (sh,csh,tcsh,...), compilers (gcc,g++,...) and the 'make' utility itself, plus much much more. I have this stuff installed on my windows machine so I can do some unix-like tasks on occasion. So I opened a shell (I like tcsh), did a 'cd' to the directory with your files, typed 'make' and it built memsim.exe. Then I typed './memsim'
and got the output.
So yes, I'd say the makefile is coded correctly.
Does that help?
Customer: replied 11 months ago.

I'm using the bash shell. When I type make on the command line it says


bash: command not found. The Makefile, memsim.cpp, memory.cpp, and memory.h are in the same (current) directory??


 

Expert:  Ingo U replied 11 months ago.
Hmm, so you have installed some pieces of cygwin also?
And when you type 'make' at the bash shell, doesn't it actually say

-bash: make: command not found

??
Customer: replied 11 months ago.


exactly


 

Expert:  Ingo U replied 11 months ago.
OK so you'll have to install the development tools (g++, make etc).
Run the cygwin setup.exe again, and select the whole "Devel" node, it should include everything you need.
But I'm confused, why did you go through the trouble with VC++ when you are trying to get it to work with bash and the makefile after all?
Customer: replied 11 months ago.

Ingo,


 


So the whole Devel node needs to be installed? This requires a lot of time and space.


Do you know specifically which particular devel packages need to be installed?


 


To answer your question, I'm learning about embedded systems and feel it is important to know the different strengths/weaknesses of each approach to solve a problem. I know you can appreciate from your background, it is important to have many different tools in your toolkit.


 


 


 

Expert:  Ingo U replied 11 months ago.
Ok, obviously you don't need the whole devel node. I'll look through it and find out what you actually need. At least gcc-g++ and make. I'll let you know.
Customer: replied 11 months ago.

ok,


 


You said earlier that you got the Makefile to work in the tcsh shell.


Can you give me the commands on how to change from the bash shell to the tcsh shell. I'll try to run make then and see if I get the same results.


 


 


 

Expert:  Ingo U replied 11 months ago.
Tell you what, see what's in C:/cygwin/bin
If you see tcsh.exe there, double click it. Then try make
If it's not there, see if make is there, or g++,
let me know
Customer: replied 11 months ago.

tcsh.exe, make.exe, and g++.exe are in c:/cygwin64/bin


 


double clicking tcsh.exe opens a terminal window.

Customer: replied 11 months ago.

tcsh.exe, make.exe, and g++.exe are in c:/cygwin64/bin


 


double clicking tcsh.exe opens a terminal window.


 


typing in make returns a "command not found"

Expert:  Ingo U replied 11 months ago.
OK, great. you need to set up your path variable like this:

set path=/cygdrive/c/cygwin64/bin/

Then cd to the directory where your makefile and code are.
Then try make
Customer: replied 11 months ago.

do I type


 


set path=/cygdrive/c/cygwin64/bin/


 


into the cygwin64 terminal window?

Customer: replied 11 months ago.

Expert:  Ingo U replied 11 months ago.
Looks like got past the path problem. But now show me your makefile - for some reason it is using cc for the final step. do a 'make clean' followed by another 'make'
My output looks like this:


Can you copy and paste your Makefile here?
Customer: replied 11 months ago.

Expert:  Ingo U replied 11 months ago.
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
Ingo U, Software Engineer
Category: Homework
Satisfied Customers: 476
Experience: Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
Ingo U and 8 other Homework Specialists are ready to help you
Customer: replied 11 months ago.

Ingo,


 


That worked. Your professional service is definitely appreciated (and admired). I will request you for all future software difficulties.


 


Have a good day.


 


Mark


 


 


 


 

Expert:  Ingo U replied 11 months ago.
Thank you Mark, for your kind comments and especially for the bonus of course. Glad it finally worked. If you start a future subject with something like "For Ingo U Only:", other experts will wait a while to give me a crack at it. If I'm unavailable for too long, eventually someone else usually offers to help.
Ingo

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience