POV-Ray : Newsgroups : povray.programming : Problems Compiling POV 3.01 with Visual C++ 5.0 Server Time
29 Jul 2024 08:10:38 EDT (-0400)
  Problems Compiling POV 3.01 with Visual C++ 5.0 (Message 1 to 8 of 8)  
From: Eric Fausett
Subject: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 23 Jul 1998 07:48:03
Message: <35B71532.497C08E8@u-aizu.ac.jp>
I'm new to this news group, but I have scoured the postings for
information related to my problem, and haven't found a solution.

I was first having a problem with the compiler freezing in lighting.c.
I found the solution to this problem, and promptly got a service pack
for Visual Studio.

I am now facing a linking error however.  I receive this error message
upon linking:

PVTEXT.OBJ : error LNK2001: unresolved external symbol
__imp__CreateToolbarEx@52
bin/povray.exe : fatal error LNK1120: 1 unresolved externals

I am using the a workspace file for VC5.0 that came with the source
files.  I have noticed that this particular definition "CreateToolbarEx"
is defined in COMMCTRL.H, and that this references the comctl32.lib
library.  This library wasn't in the list of libraries to be included
for linking, so I added it.  Upon doing so I was able to create an
executable just fine, however I would get an error upon execution of
this binary stating:

Critical Error
Error: Could not create editor window.

I'm not sure exactly what I am doing wrong.  I am new to windows
programming, and the VC++ interface.  If I can complete this compile,
then I will start coding the interface for working with implicit surface
models in POVRay.  However before this can be done, I need to be able to
compile the bare bones version.

Any help or comments would be appreciated.


Thanks,

Eric Fausett
Shape Modeling Lab
University of Aizu  JAPAN
s10### [at] u-aizuacjp


Post a reply to this message

From: Eric Fausett
Subject: Re: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 29 Jul 1998 05:24:20
Message: <35BEDC80.D7CDF1A6@u-aizu.ac.jp>
> I'm new to this news group, but I have scoured the postings for
> information related to my problem, and haven't found a solution.
>
> I was first having a problem with the compiler freezing in lighting.c.
> I found the solution to this problem, and promptly got a service pack
> for Visual Studio.
>
> I am now facing a linking error however.  I receive this error message
> upon linking:
>
> PVTEXT.OBJ : error LNK2001: unresolved external symbol
> __imp__CreateToolbarEx@52
> bin/povray.exe : fatal error LNK1120: 1 unresolved externals
>
> I am using the a workspace file for VC5.0 that came with the source
> files.  I have noticed that this particular definition "CreateToolbarEx"
> is defined in COMMCTRL.H, and that this references the comctl32.lib
> library.  This library wasn't in the list of libraries to be included
> for linking, so I added it.  Upon doing so I was able to create an
> executable just fine, however I would get an error upon execution of
> this binary stating:
>
> Critical Error
> Error: Could not create editor window.
>
> I'm not sure exactly what I am doing wrong.  I am new to windows
> programming, and the VC++ interface.  If I can complete this compile,
> then I will start coding the interface for working with implicit surface
> models in POVRay.  However before this can be done, I need to be able to
> compile the bare bones version.
>
> Any help or comments would be appreciated.
>
> Thanks,
>
> Eric Fausett
> Shape Modeling Lab
> University of Aizu  JAPAN
> s10### [at] u-aizuacjp



Could some one help me with this problem?  Has anyone encountered this
error?
I'm wondering why comctl32.lib was not one of the linking libraries icluded
in the project file
that I downloaded with the source.  After compiling I still get the error
message:

Error: Could not create editor window

This error happens when:

((editor_window = Edit.CreateEditor (main_window, tabbed_window, HomePath))
== NULL)

on line 5243 of PVENGINE.C.

Can any one tell me what I might be doing wrong? I have had one response
telling me to put editdll.dll in the same directory, however this yields no
results.  Any response would be apprciated.

Thank you,

Eric Fausett
Shape Modeling Lab
University of Aizu  JAPAN
s10### [at] u-aizuacjp


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 29 Jul 1998 10:04:14
Message: <35BF1DF8.2BDC37A@fv.aetec.ee>
Hello!

I've compiled PovRay with VC about 6 month ago, so probably I've forgotten, how
I get it worked, but here are some tips to try.

Eric Fausett wrote:

> Could some one help me with this problem?  Has anyone encountered this
> error?
> I'm wondering why comctl32.lib was not one of the linking libraries icluded
> in the project file

Well, if I remember correctly, then I had same problem. But as said in docs, VC
is not supported.

> that I downloaded with the source.  After compiling I still get the error
> message:
>
> Error: Could not create editor window
>
> This error happens when:
>
> ((editor_window = Edit.CreateEditor (main_window, tabbed_window, HomePath))
> == NULL)
>
> on line 5243 of PVENGINE.C.
>
> Can any one tell me what I might be doing wrong?

> I have had one response telling me to put editdll.dll in the same directory,
>
What do You mean by same directory? Did You put it to the same directory with
executable file (VC puts binary files to debug or bin directory, not to the
sources directory)?
Do You have installed (official) version of PovRay on the same box? Does it
work? If not, then there may be problem with editor DLL (corrupted).
Rebuild all files (from Build/rebuild all menu). If this does not work, then
rebuild again. VC has incremental building ability, which is great, but
sometimes it just does not work.
Which project target type You have (debug or release)? I had some problems,
when I tried to compile release version with maximum speed optimization: e.g.
function splitfn in file pvmisc.c produced incorrect result (input parameter
filename was modified within function; if I used local variable instead of it,
all  worked OK). (target could be set from Project/settings menu).
Try to run program without editor (set variable UseEditors to 0 in
pvengine.ini), if this does not bring PovRay up, then there is problem with
main window or tabbed window initialization.

BTW, if You get it running and have big font on tabs, then add following line
to beginning of function initialise_tabbed_window (in pvtext.c) to fix it:
  memset(&lf, 0, sizeof(LOGFONT));

Hope this helps.


Post a reply to this message

From: Ron Parker
Subject: Re: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 29 Jul 1998 10:47:45
Message: <35bf2801.0@news.povray.org>
On Wed, 29 Jul 1998 16:04:57 +0300, Vahur Krouverk <vah### [at] fvaetecee> wrote:
>> Could some one help me with this problem?  Has anyone encountered this
>> error?
>> I'm wondering why comctl32.lib was not one of the linking libraries icluded
>> in the project file
>
>Well, if I remember correctly, then I had same problem. But as said in docs, VC
>is not supported.

It could be that whoever made the VC5 project files never compiled it in
release mode (obviously, given the optimization-related lockup in 
lighting.c.) The VC5 project editor defaults to editing either debug or 
release but not both, so when comctl32 was added, it may have been added 
only to the active target.

>Do You have installed (official) version of PovRay on the same box? Does it
>work? If not, then there may be problem with editor DLL (corrupted).
>Rebuild all files (from Build/rebuild all menu). If this does not work, then
>rebuild again. VC has incremental building ability, which is great, but
>sometimes it just does not work.

Note that rebuilding will not affect editdll.dll, because it is a Delphi
DLL and is not rebuilt from VC++.  I copied the binary editdll.dll from my
official installation of POV, and it does have to be in the same directory
as the executable.  I have not encountered the error the original poster is
seeing.

>Which project target type You have (debug or release)? I had some problems,
>when I tried to compile release version with maximum speed optimization: e.g.
>function splitfn in file pvmisc.c produced incorrect result (input parameter
>filename was modified within function; if I used local variable instead of it,
>all  worked OK). (target could be set from Project/settings menu).

Does SP3 fix this optimization error?


Post a reply to this message

From: Eric Fausett
Subject: Re: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 30 Jul 1998 10:02:09
Message: <35C06F20.CF062383@u-aizu.ac.jp>
I've finally been able to Compile a Release version of Povray Using Visual
C++ 5.0.

Thank you for the pointers.  In the hope that this information can be of use
to others, here is a list of the problems I encountered and their solutions:

I downloaded and started from the Povray for Windows 3.01 Source code using
the VC++ Project file included.  (Note: Povray does not support this project
file, but they were kind enough to include it.)

#1
Upon starting the Release Build, the compile went fine until reaching the
file lighting.c.  Upon starting to compile this file, the compiler hangs.
It seems to be caught in an infinite loop (Preprocessor??) or something.
All other files compile successfully.

I found the solution to this problem in this discussion group.  It seems
that the problem is a result of another "Undocumented Feature" of VC++.
Once I downloaded and installed Service Pack 3 for Visual Studio this
problem was surmounted.

#2
After fixing the above problem, there were no further problems compiling.
Upon linking the following error was encountered:

PVTEXT.OBJ : error LNK2001: unresolved external symbol
__imp__CreateToolbarEx@52
bin/povray.exe : fatal error LNK1120: 1 unresolved externals

For some reason, the file comctl32.lib is not included in the linker
libraries and needs to be added.

#3
At this point I was able to build the executable file povray.exe, however
upon running it the following error occurred:

Critical Error
Error: Could not create editor window.

I feel like a real dolt on this one, but for some reason the output
executable has to be named pvengine.exe instead of povray.exe.  The project
file has the output defaulted to povray.exe.  Changing this solved all
problems.

One more note about the large fonts on the tabs of the editor.  This
information was provided by Vahur Krouverk in his reply to my question.  I
thought I'd post it again for completeness.

>>BTW, if You get it running and have big font on tabs, then add following
line
>>to beginning of function initialise_tabbed_window (in pvtext.c) to fix it:

>>  memset(&lf, 0, sizeof(LOGFONT));

This is my first time working with Visual Studio, so I'm learning as I go.
I'm also a novice at windows programming, so these mistakes may seem very
trivial, but I hope the info might help someone.

Now that I have a custom version going, I'll get to work on interfacing my
lab's implicit function parser with povray.  It will allow a user to create
very complex mathematical and CSG shapes easily.

Thanks again,

Eric Fausett
Shape Modeling Lab
University of Aizu  JAPAN
s10### [at] u-aizuacjp


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 30 Jul 1998 14:29:03
Message: <35C0AD8A.1FF78F3B@fv.aetec.ee>
Eric Fausett wrote:

> I feel like a real dolt on this one, but for some reason the output
> executable has to be named pvengine.exe instead of povray.exe.  The project
> file has the output defaulted to povray.exe.  Changing this solved all
> problems.

Damn,  now when You write it, then I recall as well, that I had the very same
problem.

> One more note about the large fonts on the tabs of the editor.  This
> information was provided by Vahur Krouverk in his reply to my question.  I
> thought I'd post it again for completeness.

Well, this info I got from some PovRay NG, this is not my invention.

> This is my first time working with Visual Studio, so I'm learning as I go.
> I'm also a novice at windows programming, so these mistakes may seem very
> trivial, but I hope the info might help someone.

Well, I made my first steps with VC as well by compiling PovRay: at work I use
IBM's compiler, I compiled PovRay with it and with MS one, MS version turned out
to be faster, so I use MS compiler for PovRay hacks.


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 30 Jul 1998 15:00:56
Message: <35C0B4F9.3CC2FA8@fv.aetec.ee>
Ron Parker wrote:

> >Which project target type You have (debug or release)? I had some problems,
> >when I tried to compile release version with maximum speed optimization: e.g.
> >function splitfn in file pvmisc.c produced incorrect result (input parameter
> >filename was modified within function; if I used local variable instead of it,
> >all  worked OK). (target could be set from Project/settings menu).
>
> Does SP3 fix this optimization error?

SP3? Do You mean by it Service Pack for NT? In that case I have it and it didn't
help. Or do You mean some VC++ fixes?
Actually I'm not surprised by the erroneous result of optimizations; I'm afraid that
all  C++ compilers behave more or less oddly in that case. Language itself is
complex and big and optimizations make it even harder to produce correct result.
When I encountered this error, then I had all possible optimizations for speed and
forced inlining of small functions.
Additionally, function itself (splitfn) is not good written one from my point of
view:  6+ years of C/C++ coding have taught me to be conservative and esteem code,
which is simple and without tricks, but this function uses input parameter as
variable and modifies it, instead of using local variable. If code is tricky, then
it is hard for human to understand and there is possibility for compiler to stumble
as well.


Post a reply to this message

From: Ron Parker
Subject: Re: Problems Compiling POV 3.01 with Visual C++ 5.0
Date: 30 Jul 1998 15:31:09
Message: <35c0bbed.0@news.povray.org>
On Thu, 30 Jul 1998 21:01:29 +0300, Vahur Krouverk <vah### [at] fvaetecee> wrote:
>
>
>Ron Parker wrote:
>> Does SP3 fix this optimization error?
>
>SP3? Do You mean by it Service Pack for NT? In that case I have it and it didn't
>help. Or do You mean some VC++ fixes?

No, I mean Service Pack 3 for Visual Studio 97.  Info on ordering it on CDROM
can be gotten from Microsoft's web site, but I'm not sure about international
orders.  It can also be downloaded over the web, but it's about 100 megabytes
long.

It fixes a lot of problems with global optimizations, including the one that 
causes the lockup in lighting.c.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.