Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   C++ help needed (https://www.warriorforum.com/programming/8854-c-help-needed.html)

Kevin Birch 3rd September 2008 08:05 AM

C++ help needed
 
Hi Guys

A while ago I had a little app created for me on rentacoder and by coder didn't give me instructions on how to compile it.

Is there anyone in here who could help me for a few beers?

Obviously I don't want to give everybody the zip file - maybe we can do this via email and bit by bit?

Kevin

ripsnorta2 3rd September 2008 08:39 AM

Re: C++ help needed
 
Sure Kevin, I can help.

First of all. What operating system is this written for, Windows, Mac OSX, Linux?

If it's Windows and your coder used Visual Studio, and has provided all the necessary project files, it should be a snap for you to do this yourself.

Kevin Birch 3rd September 2008 08:43 AM

Re: C++ help needed
 
Quote:

Originally Posted by ripsnorta2 (Post 75834)
Sure Kevin, I can help.

First of all. What operating system is this written for, Windows, Mac OSX, Linux?

If it's Windows and your coder used Visual Studio, and has provided all the necessary project files, it should be a snap for you to do this yourself.

Hi

Yep, the coder has provided everything - it is for windows, but I don't know how to compile it though
nor do I know what software I need - I realise that I ned vis studio - and I grabbed ms vs 2008 express but ain't got a clue what to do :-(

Can you help?

Kevin

ripsnorta2 3rd September 2008 09:07 AM

Re: C++ help needed
 
Visual Studio Express should be fine, unless your coder used an earlier version.

The way to find out is simple. Copy the project files into a folder on your C drive.

Locate the .sln file and double click on it. (Make sure VS is installed first of course :))

That should then start up Visual Studio and load the project. If the project is for an older version of VS it will tell you and prompt you to convert it. Thats' fine, just do it.

Now all you have to do is build the project.

You don't want to build a debug version, so go to the Build menu and select the Configuration Manager option. When that dialog opens, select the Active Solution Configuration list box and choose release.

Close the dialog, open the Build menu again and choose Build Solution.

That's all there is to it.

You'll then find your exe file under the Release directory in the project directory tree.

I think that's all there is involved. Let me know if you have any problems.

Kevin Birch 3rd September 2008 09:17 AM

Re: C++ help needed
 
Thanks John

I followed the instructions and i get this error:

1>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
1>stdafx.cpp
1>c:\ . . . .\stdafx.h(38) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
1>Build log was saved at "file://c:\Documents and Settings\Kevin\Desktop\...\Release\BuildLog.htm"
1>... - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

the ... replaces the directory and file as that would a big giveaway!

Any ideas?

Kevin

ripsnorta2 3rd September 2008 09:58 AM

Re: C++ help needed
 
Okay....


The first warning, D9035 is for a compiler option that detects 64 bit compatibility problems. It shouldn't be a problem until a later compiler removes that option.

This is the help given for C1083 from the visual studio documentation

To fix by checking the following possible causes
  1. File does not exist.
  2. File, subdirectory, or disk is read-only.
  3. No access permission for file or directory.
  4. Not enough file handles. Close some applications and recompile.
  5. The INCLUDE environment variable is set incorrectly.
  6. An #include directive uses double quotation marks around a path specification, which causes the standard directories to be skipped.
  7. You did not specify /clr and your program uses CLR constructs.
  8. You attempted to compile a single file in the project without first compiling stdafx.cpp. Before you can compile a single file in the project, you need to compile stdafx.cpp. In the case of the /analyze (Enterprise Code Analysis) compiler option, you will need to use the same /analyze setting for stdafx.cpp that you use for the .cpp file.
Since the afxwin.h file is a part of the VS install, I doubt that it doesn't exist. The problem is more likely that some filepath or project variable isn't set properly (options 5 and 6). However, option 8 is also a possibility.

Try right clicking on the stdafx.cpp file in the solution explorer (the tree list in the side panel on VS) and select the Compile option in the menu. If that builds okay, then try building again. Another thought is to select the Rebuild All option in the build menu.

Without seeing the project, I'm not sure if I can offer any more help. It's getting late too and I'm getting fuzzy headed, so I'm about to head off. If you'd like me to take a look at it, PM me. No charge btw.

Kevin Birch 3rd September 2008 11:59 AM

Re: C++ help needed
 
John - PM sent

Kevin

ripsnorta2 3rd September 2008 09:10 PM

Re: C++ help needed
 
Hi Kevin.

Got some bad news for you I'm afraid.

It turns out that Visual C++ Express does not include the functionality, headers, and libraries for the Microsoft Foundation Classes. Since your app uses MFC, it cannot be built.

I didn't realise this during the course of this conversation last night. I did a scan of my harddrive just to make sure, but the afxwin.h file doesn't exist.

You'll need to go and purchase Visual Studio Standard or Professional in order to compile the application. From Amazon, Standard will cost you $250, Professional will set you back $690.

Sorry to be the bearer of bad news.

Kevin Birch 4th September 2008 08:27 AM

Re: C++ help needed
 
John - just sent another PM

Kevin

Kevin Birch 4th September 2008 09:44 AM

Re: C++ help needed
 
John - please disregard the PM - I have it sorted and compiled.

I looked through the code and disabled the line that says m_bmpBG.LoadBitmapA(IDB_BITMAP_BGR to see what would happen
and bingo . . . it compiled!

Can you foresee any problems with this?

Kevin

ripsnorta2 4th September 2008 10:04 AM

Re: C++ help needed
 
Hi Kevin,

just PM'd you before I read this.

Nope. You should be okay. That variable isn't used anywhere else in the code. It's probably some copy/paste cruft left over in development.

:)


All times are GMT -6. The time now is 05:07 AM.