473,554 Members | 5,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help setting up an example app....

At school, we do all of our coding in emacs, but I am trying to get the
example apps working at home using Visual C++.net.

In the example, there are 4 .cpp files (canvas.cpp, main.cpp, myDisplay.cpp
and tween.cpp) a header file (canvas.h) and a makefile that compiles it for
linux.

The tween.cpp is the main file, and it only contains inludes statements to
the other files.

How do I set this up so that I can compile it and run it using VC++.net on a
Windows machine?

Thanks!

Brett
Nov 16 '05 #1
13 2903
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:ec******** *****@TK2MSFTNG P11.phx.gbl...
At school, we do all of our coding in emacs, but I am trying to get the
example apps working at home using Visual C++.net.

In the example, there are 4 .cpp files (canvas.cpp, main.cpp, myDisplay.cpp and tween.cpp) a header file (canvas.h) and a makefile that compiles it for linux.

The tween.cpp is the main file, and it only contains inludes statements to
the other files.

How do I set this up so that I can compile it and run it using VC++.net on a Windows machine?


Does your example use a simple character-at-a-time output model, i.e.
std::cout?

If so choose File->New->Project from the menu. Then highlight the "Visual
C++ Projects" "folder" in the tree on the left and scroll down the window on
the right to the "Win32 Console Project" icon and click it once. Then in the
edit box labeled "Name" type a short name for your project. Note the
location of your project's files which is specified two lines below. Then
click the OK button. Now click the "Applicatio n Settings" hyperlink and
choose "Empty Project". Make sure the ATL and MFC options are NOT selected.
Finally click the Finish button to create your example project.

Now copy your source and header files to your project's location. Now choose
Project->Add Existing Item from the menu. Either select all of the source
and header files at once or one at a time but make sure you have added them
all to the project. Then click Build->Build Solution from the menu.

If all goes well, you will have an executable which you can run in the
normal ways or by using either of the Start options from the debug menu.

If all does not go well, post again. News server willing, someone is almost
always here.

Regards,
Will
Nov 16 '05 #2
It didn't work. I get a ton of errors. Here are just a few of them.

c:\Program Files\Microsoft Visual Studio .NET\Vc7\includ e\stdlib.h(251) :
error C2381: 'exit' : redefinition; __declspec(nore turn) differs
c:\Program Files\Microsoft Visual Studio
..NET\Framework SDK\include\GL\ glut.h(146) : see declaration of 'exit'
c:\Documents and Settings\Brett\ My Documents\Visua l Studio
Projects\myTwee n\myDisplay.cpp (11): error C2146: syntax error : missing ';'
before identifier 'cvs'
c:\Documents and Settings\Brett\ My Documents\Visua l Studio
Projects\myTwee n\myDisplay.cpp (11): error C2501: 'Canvas' : missing
storage-class or type specifiers
c:\Documents and Settings\Brett\ My Documents\Visua l Studio
Projects\myTwee n\myDisplay.cpp (11): error C2501: 'cvs' : missing
storage-class or type specifiers

I dunno why. If i use the compiler in linux, everything works fine at
school.

Anything else to try?

"William DePalo [MVP VC++ ]" <wi***********@ mvps.org> wrote in message
news:en******** ******@TK2MSFTN GP10.phx.gbl...
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:ec******** *****@TK2MSFTNG P11.phx.gbl...
At school, we do all of our coding in emacs, but I am trying to get the
example apps working at home using Visual C++.net.

In the example, there are 4 .cpp files (canvas.cpp, main.cpp, myDisplay.cpp
and tween.cpp) a header file (canvas.h) and a makefile that compiles it

for
linux.

The tween.cpp is the main file, and it only contains inludes statements to the other files.

How do I set this up so that I can compile it and run it using VC++.net

on a
Windows machine?
Does your example use a simple character-at-a-time output model, i.e.
std::cout?

If so choose File->New->Project from the menu. Then highlight the "Visual
C++ Projects" "folder" in the tree on the left and scroll down the window

on the right to the "Win32 Console Project" icon and click it once. Then in the edit box labeled "Name" type a short name for your project. Note the
location of your project's files which is specified two lines below. Then
click the OK button. Now click the "Applicatio n Settings" hyperlink and
choose "Empty Project". Make sure the ATL and MFC options are NOT selected. Finally click the Finish button to create your example project.

Now copy your source and header files to your project's location. Now choose Project->Add Existing Item from the menu. Either select all of the source
and header files at once or one at a time but make sure you have added them all to the project. Then click Build->Build Solution from the menu.

If all goes well, you will have an executable which you can run in the
normal ways or by using either of the Start options from the debug menu.

If all does not go well, post again. News server willing, someone is almost always here.

Regards,
Will

Nov 16 '05 #3
Its an OpenGL based app, so maybe I don't have it set up right? I did what I
could find on the net, I got all the files, and put them in the lib folder
of C++, where they say to put it.

I was going by a ppt I found online, but the one slide that has C++.NET info
was in chinese, the rest was all in english, and I can't read it. I think I
have to add "opengl32.l ib, glut32.lib and glu32.lib" to some project
settings, but I dunno where that is.
"William DePalo [MVP VC++ ]" <wi***********@ mvps.org> wrote in message
news:en******** ******@TK2MSFTN GP10.phx.gbl...
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:ec******** *****@TK2MSFTNG P11.phx.gbl...
At school, we do all of our coding in emacs, but I am trying to get the
example apps working at home using Visual C++.net.

In the example, there are 4 .cpp files (canvas.cpp, main.cpp, myDisplay.cpp
and tween.cpp) a header file (canvas.h) and a makefile that compiles it

for
linux.

The tween.cpp is the main file, and it only contains inludes statements to the other files.

How do I set this up so that I can compile it and run it using VC++.net

on a
Windows machine?
Does your example use a simple character-at-a-time output model, i.e.
std::cout?

If so choose File->New->Project from the menu. Then highlight the "Visual
C++ Projects" "folder" in the tree on the left and scroll down the window

on the right to the "Win32 Console Project" icon and click it once. Then in the edit box labeled "Name" type a short name for your project. Note the
location of your project's files which is specified two lines below. Then
click the OK button. Now click the "Applicatio n Settings" hyperlink and
choose "Empty Project". Make sure the ATL and MFC options are NOT selected. Finally click the Finish button to create your example project.

Now copy your source and header files to your project's location. Now choose Project->Add Existing Item from the menu. Either select all of the source
and header files at once or one at a time but make sure you have added them all to the project. Then click Build->Build Solution from the menu.

If all goes well, you will have an executable which you can run in the
normal ways or by using either of the Start options from the debug menu.

If all does not go well, post again. News server willing, someone is almost always here.

Regards,
Will

Nov 16 '05 #4
In case you want to try, here are the files that I am trying to get working.

http://www.cs.unb.ca/profs/nickerson...les/index.html

Get the rectangle example, its the simplest one.
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:ec******** *****@TK2MSFTNG P11.phx.gbl...
At school, we do all of our coding in emacs, but I am trying to get the
example apps working at home using Visual C++.net.

In the example, there are 4 .cpp files (canvas.cpp, main.cpp, myDisplay.cpp and tween.cpp) a header file (canvas.h) and a makefile that compiles it for linux.

The tween.cpp is the main file, and it only contains inludes statements to
the other files.

How do I set this up so that I can compile it and run it using VC++.net on a Windows machine?

Thanks!

Brett

Nov 16 '05 #5
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:Op******** ******@TK2MSFTN GP11.phx.gbl...
It didn't work. I get a ton of errors. Here are just a few of them.
...


First, I should point out that when I asked:

"Does your example use a simple character-at-a-time output model, i.e.
std::cout?" I was trying to determine if you were doing something that would
port easily. If I had known that you were trying to port an OpenGL
application I would have let your question go right on past me. :-)

But as I am already involved, and as I have been spending some time with my
senior-year niece getting her up to speed on VS.Net, I downloaded your
example. :-)

Your example does what I have rarely seen done - it uses #include to include
other source files rather than header files. I'll pass on whether this is a
good idea or not and simply point out that in order for this to work with
VS.Net's build mechanism, you'd have to remove all of the source files from
the project _except_ rectangle.cpp which will include the others.

The crux of your problem, I think, is that the header file

GL/glut.h

is nowhere to be found on a standard Win32 installation (at least it is not
on this XP/Pro/SP1box).

I found it here:

http://www.xmission.com/~nate/glut.html

So, I downloaded the ZIP file, copied the header (.h file), the import
library (.lib file) and dynamic link library (.dll file) to the project
directory and modified the source of the rectangle example slightly:

//---------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include "glut.h"

#define WINDOW_HEIGHT 256
#define WINDOW_WIDTH 256

#include "init.cpp"

#include "myMouse.cp p"

#include "myDisplay. cpp"

#include "main.cpp"
//---------------------------------------------

Then I built the project.

Surprsingly, it built without errors!

It almost worked - that is it displayed an ugly black frame window.

If, however, you activate the OpenGL window by clicking the window's "client
area" (i.e. neither the borders nor the caption) with the mouse, the sample
will draw a white rectangle, about half as large as the black container, and
centered within it.The click is required as well if you move the window.

That may get you started. You'll need to do some leg work to get the example
to work without the cludge of the mouse click.

Regards,
Will




Nov 16 '05 #6
I did exactly what you said, but I get the following error when I try to
compile it:

c:\Program Files\Microsoft Visual Studio .NET\Vc7\includ e\stdlib.h(251) :
error C2381: 'exit' : redefinition; __declspec(nore turn) differs

Any ideas why?

Brett
"William DePalo [MVP VC++ ]" <wi***********@ mvps.org> wrote in message
news:uj******** *****@TK2MSFTNG P11.phx.gbl...
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:Op******** ******@TK2MSFTN GP11.phx.gbl...
It didn't work. I get a ton of errors. Here are just a few of them.
...
First, I should point out that when I asked:

"Does your example use a simple character-at-a-time output model, i.e.
std::cout?" I was trying to determine if you were doing something that

would port easily. If I had known that you were trying to port an OpenGL
application I would have let your question go right on past me. :-)

But as I am already involved, and as I have been spending some time with my senior-year niece getting her up to speed on VS.Net, I downloaded your
example. :-)

Your example does what I have rarely seen done - it uses #include to include other source files rather than header files. I'll pass on whether this is a good idea or not and simply point out that in order for this to work with
VS.Net's build mechanism, you'd have to remove all of the source files from the project _except_ rectangle.cpp which will include the others.

The crux of your problem, I think, is that the header file

GL/glut.h

is nowhere to be found on a standard Win32 installation (at least it is not on this XP/Pro/SP1box).

I found it here:

http://www.xmission.com/~nate/glut.html

So, I downloaded the ZIP file, copied the header (.h file), the import
library (.lib file) and dynamic link library (.dll file) to the project
directory and modified the source of the rectangle example slightly:

//---------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include "glut.h"

#define WINDOW_HEIGHT 256
#define WINDOW_WIDTH 256

#include "init.cpp"

#include "myMouse.cp p"

#include "myDisplay. cpp"

#include "main.cpp"
//---------------------------------------------

Then I built the project.

Surprsingly, it built without errors!

It almost worked - that is it displayed an ugly black frame window.

If, however, you activate the OpenGL window by clicking the window's "client area" (i.e. neither the borders nor the caption) with the mouse, the sample will draw a white rectangle, about half as large as the black container, and centered within it.The click is required as well if you move the window.

That may get you started. You'll need to do some leg work to get the example to work without the cludge of the mouse click.

Regards,
Will




Nov 16 '05 #7
I commented out the
#include <stdlib.h> line and it seems to work correctly!

"William DePalo [MVP VC++ ]" <wi***********@ mvps.org> wrote in message
news:uj******** *****@TK2MSFTNG P11.phx.gbl...
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:Op******** ******@TK2MSFTN GP11.phx.gbl...
It didn't work. I get a ton of errors. Here are just a few of them.
...
First, I should point out that when I asked:

"Does your example use a simple character-at-a-time output model, i.e.
std::cout?" I was trying to determine if you were doing something that

would port easily. If I had known that you were trying to port an OpenGL
application I would have let your question go right on past me. :-)

But as I am already involved, and as I have been spending some time with my senior-year niece getting her up to speed on VS.Net, I downloaded your
example. :-)

Your example does what I have rarely seen done - it uses #include to include other source files rather than header files. I'll pass on whether this is a good idea or not and simply point out that in order for this to work with
VS.Net's build mechanism, you'd have to remove all of the source files from the project _except_ rectangle.cpp which will include the others.

The crux of your problem, I think, is that the header file

GL/glut.h

is nowhere to be found on a standard Win32 installation (at least it is not on this XP/Pro/SP1box).

I found it here:

http://www.xmission.com/~nate/glut.html

So, I downloaded the ZIP file, copied the header (.h file), the import
library (.lib file) and dynamic link library (.dll file) to the project
directory and modified the source of the rectangle example slightly:

//---------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include "glut.h"

#define WINDOW_HEIGHT 256
#define WINDOW_WIDTH 256

#include "init.cpp"

#include "myMouse.cp p"

#include "myDisplay. cpp"

#include "main.cpp"
//---------------------------------------------

Then I built the project.

Surprsingly, it built without errors!

It almost worked - that is it displayed an ugly black frame window.

If, however, you activate the OpenGL window by clicking the window's "client area" (i.e. neither the borders nor the caption) with the mouse, the sample will draw a white rectangle, about half as large as the black container, and centered within it.The click is required as well if you move the window.

That may get you started. You'll need to do some leg work to get the example to work without the cludge of the mouse click.

Regards,
Will




Nov 16 '05 #8
"Brett Baisley" <bb******@nbnet .nb.ca.REMOVE> wrote in message
news:ey******** ******@tk2msftn gp13.phx.gbl...
I did exactly what you said, but I get the following error when I try to
compile it:

c:\Program Files\Microsoft Visual Studio .NET\Vc7\includ e\stdlib.h(251) :
error C2381: 'exit' : redefinition; __declspec(nore turn) differs

Any ideas why?


It happened to me too until I changed the order of the header files as in my
post. It compiled, I didn't investigate.

Regards,
Will
Nov 16 '05 #9
I did it your way, and it works the way it should.

Now I am wondering how to do it the right way. Like I tried adding all of
the existing files just as they are to the solution in VC++.NET, but when I
build the solution, I get errors.

So then I took out all of the include statements and tried that, but the
same thing. It seems to me, that when I compile the solution, it compile
each file separately, therefore it can't find things located from one of the
other files.

How do I fix that problem? So that I can hit F5 and it run normally? Is
there a way to tell it what file to run first or something?

Thanks for all your help by the way!

Brett
Nov 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2720
by: Niyazi | last post by:
Hi, We have and IBM AS400 and I belive the reional setting is Turkish. The IBM Client-Access for Windows that install in our PC (WIN XP SP2) set to Turkish characters. Now my PC has English (US) regional setting and I am not having any problem to connect. But If I change my PC Regional setting to Turkish all of my VB.NET code is
5
27820
by: dixie | last post by:
I want to be able to set the font size and font type for text in a text box on a report using VBA. I wan't to be able to control it from a setting in a table. The problem is that I don't know the syntax for setting either font type or font size for a text box on a report. Does anyone know? Help. Please! dixie
16
2508
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client uses IE to talk with a server. The user on the client (IE) sees an ASP net page containing a TextBox. He can write some text in this text box and...
11
4062
by: Dudely | last post by:
The following file, as far as I know, should work. However, I get a blank page. Using IE 7 "test2.html" is a simple file which has nothing more than "Goodbye World" in it. Am I doing something wrong? If so, what? If not, why doesn't this work for me? I've also tried it using an absolute path for test2.html - makes no difference.
2
2235
by: bilalinamdar | last post by:
hello this is my first post in this forum... I am just a BEGINNER.. Not much Understanding.. I have a website which consist a BOX and a Submit Button I would like to make a custom setting to it... Also would like to separte it in a EXTERNAL CSS.. i already have other codes but want to incorporate this.. Really confused with the CLASS, ID,...
15
1956
by: rhino | last post by:
I've put together a prototype of two-tiered CSS tabs that works really well in IE6, IE7, and FF2. It also works very well in Opera 9.27 _except_ that the placement of the lower tier of tabs is messed up. Both the XHTML and CSS validate without any errors or warnings. Can anyone help me figure out what is wrong? I'd be especially interested...
6
3579
by: Mark B | last post by:
I have a function that looks up a SQL table to see if a search term matches. It works fine but so far there are two things yet to work: 1) After entering a search term and pressing Enter, nothing has been happening. It has only been searching when I click the Search button. 2) Neither of the Response.Write's have been displaying any text....
11
2863
by: casucci | last post by:
I do a return as XMLDataDocument in my webservice but it returns not with the namespaces etc in them. Anyone have and example where I can have the webservice return it as a XML. C# preferred. Flash just sees it as an object when it calls the web service. Thanks
15
2264
ajhayes
by: ajhayes | last post by:
I posted a question here last week about an ordering database I'm trying to set up, and got some excellent help. So I'm hoping some of you might be able to get me on the right track with another question I've got on the same project. Here's some general info on what I've done so far (For the record, I'm quite a novice at this.): The...
0
7503
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7538
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7869
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5421
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3543
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3531
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2003
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1113
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.