C code in a BPL

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

C code in a BPL

Postby gbrandt » Fri Mar 05, 2010 4:29 pm

Builder 2010, Windows 7 32 bit.

I have created a BPL that uses the sqlite source code. compiling and linking the BPL works fine. Compiling and linking any application that uses the bpl brings up link errors like this:

Code: Select all
[ILINK32 Error] Error: Unresolved external '_sqlite3_open' referenced from C:\USERS\PUBLIC\DOCUMENTS\RAD STUDIO\7.0\DCP\ERLPHASEBPL.LIB|SQLServer.cpp


I would have thought that the sqlite3.obj was part of the bpl and that the code would be found just fine. Am I missing something. I put the sqlite3.obj in the library search path but that did not fix the issue.

This most certainly has something to do with this being C code, but I can't figure out.

Thanks,
Gregor
gbrandt
Top Poster
Top Poster
 
Posts: 41
Joined: Thu Feb 11, 2010 12:45 pm

Re: C code in a BPL

Postby gambit47 » Fri Mar 05, 2010 5:26 pm

gbrandt wrote:I would have thought that the sqlite3.obj was part of the bpl and that the code would be found just fine. Am I missing something. I put the sqlite3.obj in the library search path but that did not fix the issue.


But is the .obj file actually *IN* the BPL project itself - either via "Add to Project" or more likely a "#pragma link" in the code? Just pointing the project to the library path is not enough to import files during compiling if the compiler/linker does not know what it is supposed to be looking for.
Remy Lebeau (TeamB)
http://www.lebeausoftware.org
User avatar
gambit47
BCBJ Author
BCBJ Author
 
Posts: 472
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: C code in a BPL

Postby gbrandt » Fri Mar 05, 2010 5:44 pm

sign, ok, if we ever meet I owe you a few beers for the answers....

I have other .obj files produced by C++ code and they don't need the #pragma link, although they did get a #pragma package( smart_init) (which did not work for C).

Thanks for the help, that was the solution.

Gregor
gbrandt
Top Poster
Top Poster
 
Posts: 41
Joined: Thu Feb 11, 2010 12:45 pm

Re: C code in a BPL

Postby mikesleves » Tue Mar 30, 2010 6:56 am

Whenever you compile the code at that time compiler make the code into the assembly language and then after it goes in the use-define languages.
mikesleves
 
Posts: 3
Joined: Tue Mar 30, 2010 6:51 am


Return to Technical

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest

cron