Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:14:29+00:00 2026-06-15T03:14:29+00:00

I have two Free Pascal units that I would like to use from a

  • 0

I have two Free Pascal units that I would like to use from a C program on linux.

Here is what I do:

$ fpc -fPIC base64.pas queueutils.pas
Warning: Only one source file supported
Free Pascal Compiler version 2.2.2 [2008/11/05] for x86_64
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Linux for x86-64
Compiling queueutils.pas
queueutils.pas(2088,11) Warning: Symbol "Socket" is deprecated
queueutils.pas(2097,10) Warning: Symbol "Connect" is deprecated
queueutils.pas(2104,3) Warning: Symbol "Sock2Text" is deprecated
2432 lines compiled, 0.5 sec
4 warning(s) issued

$ ppumove -o queueutils -e ppl *.ppu
PPU-Mover Version 2.1.1
Copyright (c) 1998-2007 by the Free Pascal Development Team

Processing base64.ppu... Done.
Processing queueutils.ppu... Done.
Linking queueutils.o base64.o
Done.

Seems fine so far, libqueueutils.so is created:

$ file libqueueutils.so
libqueueutils.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

$ ldd libqueueutils.so
ldd: warning: you do not have execution permission for `./libqueueutils.so'
        statically linked

However when the C program tries to use the library this way:

libqueue = dlopen("./libqueueutils.so", RTLD_LAZY);
if (!libqueue) {
  fprintf (stderr, "%s\n", dlerror());
}

it yields an error message:

$ ./tmbrkr
./libqueueutils.so: undefined symbol: VMT_PROCESS_TPROCESS

This VMT_PROCESS_TPROCESS-related error is resolved if I add process.o and process.ppu to the linking process done by ppumove. However after doing so another unit is missing and after that another… You get it.

Is there a way to somehow link all the necessary units together in one .so file so that the C program can dlopen() the library properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:14:32+00:00Added an answer on June 15, 2026 at 3:14 am

    Just like a normal binary (exe) is from a “program” source file , a .so/dll is created from a ”library” sourcefile.

    For the rest is the model is the same. You simply build the library mainprogram, and the compiler collects all units necessary and stuffs them in the .so.

    With the exports keyword you can define what symbols to export.

    library testdll;
    
    uses x,y,z;
    
    // define exportable symbols here
    
    // some examples of symbol exports
    exports
       P1 index 1,  // dll based on index
       P2 name 'Proc2', // normal export with alternate external symbol
       P3,               // just straight export.
       P4 resident    // for some MCU use
       ;
    
    begin
      // startup code
    end.
    

    Also look up $soname $libsuffix and $libprefix in the manual.

    Though I would recommend just using most recent 2.6.0, not some 5 year old 2.2.2

    It might require recompiling FPC first with PIC though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two questions: From personal experience, what free blog engine is the best
I have two free apps, iSys and iSysMonitor, that report info about my iPhone.
I have two regular expressions that I use to validate Colorado driver's license formats.
I have two apps (free & paid) that are exactly same except for ad
I have two videos that I'd like to combine into a single video, in
I have two separate projects, a plus and free version. Both projects use a
I have two app icons built-in (free and premium), is it possible to replace
What I am trying to achieve is to have two control modes, a free
I have a UITableView with two sections: free and paid. Each section has a
I have two classes (MVC view model) which inherits from one abstract base class.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.