Solved

Easy help with compiling please!

Posted on 2004-09-19
6
541 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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