Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating makefile's for DLL's!!! 1

Status
Not open for further replies.

ctoma2005

Programmer
Jun 15, 2006
26
0
0
RO
Hy. I have to create a makefile for buiding a DLL. The DLL contains only a resource file(jpg's and waw's). The game i am working on is written in C++ builder. I want to create a makefile and using project -> export_makefile doesn't work(it gives me an "access violation" when I type "make -f data.mak" at the command line). Somebody help me!! Thanks in advance.
 
That helps me (I learned more about makefiles), but it doesn't help me :( .Let me be more explicit about my problem:
I have some pictures and sounds and a data.rc with their id's. I compile data.rc and make a data.res. From that file I want to create the dll, but not with cbuilder. I want to use a makefile. The problem is that I get a "share access violation" when I open the project, but I can pass this problem in the IDE. But when the makefile compiles the file, it can't pass the error. I have no idea from where the error comes, since in the IDE it is not fatal! (I just press OK).
It is not very eficient to make a makefile for such a little project, but that's my job :( .
If someone can help me....please!!!!

This is the exact error: "Error creating form: Access violation at address..." (I understand the error, since the project is a dll). I tried to make just a source code, not a project, but I still get an fatal error when making the makefile.
 
would you post your makefile so we could make some mode informed guess? ;))
 
Ok.
The source code looks like this:
" #include <windows.h>

#pragma resource "data.res"
#pragma argused
BOOL WINAPI DllEntryPoint(HINSTANCE, DWORD, LPVOID)
{
return TRUE;
}
"

The makefile looks like this:
"
.autodepend
resources.dll : main.cpp
bcc32 -WDR main
"

The .rc file looks like any resource file (with id's for
every picture and sound).

From this files I have to create a compile.bat file, witch
should look like this:
"
BRCC32 data.RC
make -f dll.mak
".
I think I didn't do anything wrong but the dll is created, but it's no good. When compiling the .bat file, it
gives me an error: " Fatal: access violation. Link terminated ".
I get this kind of error even if I make a dll project in C Builder, but there I just press OK.
 
Ok... I read the posts, but I already know how to create the dll and use the stored jpg's. My problem is with creating the makefile for the JPG!!I want to use a simple .bat file to create the dll, that is why i need the makefile.As I said, when typing "make -f data.mak" it gives me an error that I get when building the dll project in C buider, but it's not fatal. Maybe I'll figure it out somehow... Thanks! :)
 
You probably should be adding the .res file (generated by brcc32) to the dependencylist of resources.dll like:
Code:
data.res: data.rc
    brcc32 data.rc

resources.dll: main.cpp data.res
    bcc32 -WDR main
(Untested script)

This should force both data.rc to be compiled to data.res and main.cpp + data.res into main.dll (!!!) Adding -eresources to the bcc32 line should resolve that (also untested)

HTH
TonHu
 
Hmmm....this doesn't work either...
It still gives me the error "Fatal: Access violation. Link terminated" when typing "make -f data.mak". I see that the error comes from "main.cpp", and that the .res file and the .mak file is good. I think I need some option when building the .cpp file (maybe something like "silent" compiling, to try to bypass some errors/warnings).
I just realised that making that DLL doesn't worked in C Builder neither if I don't press "release" from
project->options. Maybe I need to do that but I can't tell the make command to do that!!
You don't have to loose more time with this problem, since I don't have to do this right away...but I am very curios to find the answer...
 
using your codes, I got main.dll compiled no problem at all. I used Borland free command line tools (BC++5.5)
If some spaces are missing make says something like "Error dll.mak 4: Command syntax error", but no any violation.
makefile I used (and got main.dll ):
Code:
.autodepend
resources.dll : main.cpp
   bcc32 -WDR main
other one, to get it named resources.dll:
Code:
.autodepend
resources.dll : main.cpp
  bcc32 -WDR -eresources main
I wonder if it's just "make" bug - check if Borland site has an update may be?
 
You are proably right. I'm going to download the free compiler from Borland later. Thank's very much for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top