Solved

Easy help with compiling please!

Posted on 2004-09-19
6
540 Views
Last Modified: 2013-12-06
Hello!

I'm an OpenGL newbie, and I've been desperately attempting to compile some OpenGL programs without luck. So far I was only successful in getting one file compiled and run, but not the others.

I have all the correct dlls, libraries, header files installed in the correct folders. So far I've been successful only in getting this one to work:

http://www.nullterminator.net/glsample.zip

So I extracted glsample.cpp, and I put bcc32 -tW glsample.cpp
and it compiled and worked fine.

Whereas, if I try to compile:
http://www.opengl.org/resources/code/basics/samples/accum.c

by using bcc32 accum.c, I got this:

Error E2141 D:\Borland\BCC55\include\GL/gl.h 1153: Declaration syntax error
Error E2238 D:\Borland\BCC55\include\GL/gl.h 1154: Multiple declaration for 'WINGDIAPI'
Error E2344 D:\Borland\BCC55\include\GL/gl.h 1153: Earlier declaration of 'WINGDIAPI'


The same thing happened if I compile it this way:
bcc32 opengl32.lib glut32.lib glu32.lib accum.c


I really don't know what else to do, and if anyone can help me, I'll appreciate that! I don't really care how or what I should use to compile, as long as I can compile OpenGL programs and make them work/run.
So far, I have opengl32.lib placed in the /lib directory of my compiler (which is Borland C++), and I have glut32.h and glu32.h placed in the /include/GL directory. The correct dlls are also placed in WINNT\system32 (I am using Win2k) So if there's any more files I need to have placed, I'd be glad to know. You can also tell me any IDE of your choice, and I'll follow it.
Again, I just want to get some programs to compile and make them w-o-r-k. *grrrrrrrrr* :-)

Thank you!!!
0
Comment
Question by:zpivat
6 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 12099777
Post lines 1148-1158 of gl.h ... Seems like a syntax error
0
 

Author Comment

by:zpivat
ID: 12100826
But how is that a syntax error? Afterall I got to compile and run glsample.cpp successfully.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 12100840
Sytax error in the program that you are trying to compile now. One program compiling successfully does not imply all programs will comile successfully
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:zpivat
ID: 12105012
Yes, but the thing is....out of all programs I've tried to compile, only glsample.cpp did successfully. None of the other files compiled, and I think that doesn't make sense. And I've tried this at least with 50 different files.
0
 

Expert Comment

by:Wyverex
ID: 12201569
Try to change the order in which the headers are included. Sometimes a header is included more than once by a circular reference. I had similar problems in the past.
0
 
LVL 3

Accepted Solution

by:
Srm74 earned 50 total points
ID: 12367040
Hi,
I'm almost sure this will solve it..
This error message is caused by using the wrong platform selection in your project file. Open your project. Right click the .exe file in the project window and select "Target Expert." Change the platform to "Win32" and change target model to "Console." Upon successful recompilation, your program should work.

Hope this helps
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now