SCIENTIFIC-LINUX-USERS Archives

July 2009

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nicola Maggi <[log in to unmask]>
Reply To:
Nicola Maggi <[log in to unmask]>
Date:
Fri, 17 Jul 2009 18:27:02 +0200
Content-Type:
multipart/mixed
Parts/Attachments:
text/plain (1460 bytes) , okFrontPanelDLL.cpp (74 kB) , okFrontPanelDLL.h (18 kB)
Hello to everyone,
maybe this question is a bit off topic but I'm having a lot of trouble
with some application using shared libraries.

I have a FPGA .so file which is provided by the FPGA manufacturer.
In addition I have .cpp/.h files which defines a class to wrap around
some methods to the DLL entry points.

If I write a stand-alone application to access this library everything
works fine,I can create objects and access .so functions.

Anyway I  have to build another object library which uses the FPGA library.
the code to load the library seems to work fine:
__________________________________________
okCUsbFrontPanel *device;
if (FALSE == okFrontPanelDLL_LoadLib(NULL)) {
		printf("FrontPanel DLL could not be loaded.\n");
		DEBUG_TEXT(DFDB_RCDDETECTOR, 15, "raps::constructor: initialized");
    	// TODO:throw exception
  	}else{
		printf("Frontpanel DLL loaded.\n");
		device= new okCUsbFrontPanel();
        }
__________________________________________
When executing device= new okCUsbFrontPanel(); I get a segfault error
(exit status 11).

I compile my shared library in this way:
g++ -shared -ldl -o libReadoutModuleRAPS.so okFrontPanelDLL.o
ReadoutModuleRAPS.o

where ReadoutModuleRAPS.o is the object of the source in which i used
the code above.

I really don't understand why does the stand-alone application works
and the shared one doesn't.
Does anyone have any idea?

Thank you,
Nicola Maggi

ps.I attached the source code of the library- hope I din't break any
maling list rule.


ATOM RSS1 RSS2