CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-15-2003, 09:16 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
More on compiling (VC++ .NET)

Hi,

I know the only supported compiler on Windows is VC++ 6.0. Unfortunately, I've only got Visual Studio .NET.

I've discovered some things that will help to get this working, but still have some problems that I'd love to get help with.

The (compile-file ...) function appears to blow up in pass 3 (after the .C file has been generated). When I tried to compile a file, I got the error (in the console window) that 'cl' was not a valid program file (cl is the C compiler). I figured that it probably was just not in the path, so added that to the environment variable, restarted Designer Modeling, and tried again. Slightly different error, but still no go -- error on pass 3 (still).

So after doing a little digging, I found a file in the Visual Studio .NET\Common7\tools directory called vsvars32.bat whose whole purpose is to set up the correct environment variables to allow Visual Studio .NET to work from the command line. Since the batch file where the error was occurring is 'sdlcpas3.bat' I added a line right at the top to call vsvars32.bat to set the environment. It worked! (well, almost...)

It turns out that VC++ 6.0 missed some definitions and structures in their header files, (one notable one is tagPALETTEENTRY structure). As such, the .C file generated has this definition in it. VC++ .NET, however, has this defined, resulting in a duplicate definition (and thus a compile error). The line in the .C file preceding the definition is "#if _MSC_VER >= 1200" so the definition doesn't get set up on earlier versions. Unfortunately, it *does* get set up for ALL later versions...

I looked for any files that might be used as templates for this .C file to see if I could modify the above "#if ..." line not to define the structure, but was unable to find anything containing "tagPALETTEENTRY" in any of the OSD 11.6 directories.

I was able to generate the .dll file by modifying the .C file and manually running it through sdlcpas3.bat, but when I tried to load the resulting dll, I got an error message "Lisp Error: Initializer function not found for <filename>.dll" Is there something else that I need to do manually to make the dll work?

So 2 questions:
1) Any thoughts on how I can make solve the problem with the compiler (i.e. the duplicate struct definitions)?

2) Any ideas why the dll won't load properly? (I've compiled and loaded files on Unix before, but not on Windows).

Thanks for any help you can provide!

Andy
Reply With Quote
  #2  
Old 04-16-2003, 12:45 AM
rolandr rolandr is offline
Junior Member
 
Join Date: Feb 2003
Location: Germany, near Boeblingen
Posts: 3
Hi Andy,

You're right this template doesn't exist
as separate file in the installation. However, this could be solved. But,
since the latest compiler also comes
with a new version of the runtime library (msvcrt70.dll) which is basically incompatible with the old one, it is not a good idea to compile files with the new compiler.

So, I can't recommend using the new
compiler as it is. You should at least "install" include files and libraries from the old compiler. I.e. a reasonable fix would be to put includes and libraries of the old compiler somewhere on your PC, change the include and lib environment variables (or the sdlcpas3.bat-file) to reference to these files and create your dlls.

Roland
Reply With Quote
  #3  
Old 04-16-2003, 12:46 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Thanks for the reply. So I assume it's reasonable to conclude that the different runtime libs are the reason the compiled dll won't load? What is the "initializer" function mentioned in the error message (and why would it change from version 6 to 7 of VC++?)

Thanks for your insight!

asp
Reply With Quote
  #4  
Old 04-16-2003, 10:39 PM
rolandr rolandr is offline
Junior Member
 
Join Date: Feb 2003
Location: Germany, near Boeblingen
Posts: 3
I doubt that the runtime library differences are causing this failure.
The initializer function is the name of the function which contains all the code required to initialize the lisp file. Among other internal stuff everything done in the lisp file on top level is being executed here. If the loader doesn't find this function its a fatal error.
But the name of the initializer function should not change between different compiler versions. However if you're not using the correct set of compile options to compile the file such a problem can occur. But if I remember things correctly you were using the sdlcpas3.bat file to compile the file. So this should not be the case.
I did a test here with a setup as described in my last reply (picking up the correct set of header files and libraries while using the new compiler) and I could load my dll. I'm afraid, I'm running out of ideas here.
You could send me your dll for tests. But I won't be around for the rest of this week and the complete next week to do these tests.

Roland
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:47 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.