0

I have a shared library has built in rational rose and the target system is set to ppcbe. I try load the created so file by dlopen() command in QNX Momentics IDE while connecting to target system. QNX IDE resides on WIN7 64bit. I set the mylib.so file in Extra Object files. The build Project is done whithout no problem. but dlerror() gives me the following error: ldd:FATAL: Couldn't load library C:/ide-4.7-workspace/myproject/mylib.so

Some searches leaded me to set the LD_LIBRARY_PATH to target use/lib path. The so file is also copied in this target path. but the error didnt resolved. My surprise is why loader tries to find the library in a windows path, while i expect to locate it in target system path. I'm really frustrated. appreciate any hint.

hamid
  • 19
  • 7
  • Hello Hamid. Please write here where is located your so file in the host machine and in the target machine. I need from you two paths. – Oleg Gopkolov Jul 07 '17 at 06:08
  • Do you have a header file of your library. For example, "mylib.h" ??? – Oleg Gopkolov Jul 07 '17 at 06:15
  • And where this header file is located in the host machine ??? – Oleg Gopkolov Jul 07 '17 at 06:25
  • Hi Oleg. i took two approaches to loade my so file. First i copied the so file into one of my target path included in LD_LIBRARY_PATH of my target machine. when running dlopen() command to load the library, it crashes and get in halt. I active the memory analyzer of QNX and it gave the following error: – hamid Jul 09 '17 at 03:32
  • attempt to free a block not allocated: 0x48059ec8. So i guess have heap corruption. Probably there is double free pointer problem or some illegal task in pointers. But the so file source code is too huge and impossible to find such illegal task didn't find in library generation process. – hamid Jul 09 '17 at 03:53
  • In second approach i copied all header files of so file in my program and added the so file in extra library path. so file is located in my workspace host machine. Also i added the LD_LIBRARY_PATH in envirnoment variable setting of my windows host machine. but the error stays same and gives me Couldn't load library C:/ide-4.7-workspace/myproject/mylib.so. – hamid Jul 09 '17 at 03:54
  • Are you compile library for ppcbe platform??? – Oleg Gopkolov Jul 10 '17 at 06:43
  • yes. I compile the code for ppcbe targetT NEUTRINO630T OS and gnu-3.3.5 compiler. Also in QNX i create my App for ppcbe type target variabt and gcc.3..3.5 compiler. Now i'm trying to learning and creating a shared library from simple project in Rational Rose to be sure if the problem backs to source code or capability of this software in creation linux shared library. – hamid Jul 10 '17 at 12:25
  • Try to invoke executable directly in the target machine (not from IDE). What is your target machine. It is real or virtual machine??? – Oleg Gopkolov Jul 11 '17 at 04:24
  • If you want you can share so file and I will try to load from my comp. It is very interesting for me why you can't load library – Oleg Gopkolov Jul 11 '17 at 04:31
  • My target is a real ppcbe industrial cpu. I appreciate your attention but the library and it's source code has been bought by my company in high price and it's against of my commitment to my contract. – hamid Jul 12 '17 at 04:18
  • I don't need source code of your library. You can send me only binary. – Oleg Gopkolov Jul 19 '17 at 10:37
  • Sorry for my late answer. Eventually i realized the source of problem relates to rational rose RT library (Not the source code). I created very simple project in rational rose in which i defined just an extern function as name 'printmessage()' which printed 'hello'. To be sure first took it's dll in rational rose and tested in visual c++.Net successfully – hamid Jul 23 '17 at 04:16

0 Answers0