free

News

collapse

User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 202
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Birthday Calender

December 2025
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 [29] 30 31

gcc & -fPIC issues

Teddy · 992

0 Members and 1 Guest are viewing this topic.

Offline TeddyTopic starter

  • Orc
  • *****
    • Posts: 9161
  • "I'm on top of the world because of you."
  • With us since: 05/02/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
on: September 26, 2014, 01:09:48 am
Hello,

I appear to be a bit stuck so I'll go out on a limb here and reach out to the community for some assistance. I have a C file which has the following includes:
Code: [Select]
#include "SQFuncs.h"
#include <stdio.h>
#include <stdlib.h>

Because of the last stdlib.h header which is shared library available on all major platforms and importantly adds the int system(..) function which is the purpose of the module.

The issue I am running into is the shared library doesn't get utilized properly on Linux and causes the server to error. While on Windows the code complies and executes efficiently.

I have the following Makefile used to build the .so file for Linux.
Code: [Select]
SDK_objs = SQMain.o SQFuncs.o

CXX = gcc -fPIC -g
CXXFLAGS = -O2 -DNDEBUG -I.

all: lu_exec.so

default: all

lu_exec.so: $(SDK_objs)
$(CXX) -o $@ $(SDK_objs) -shared -s

SQMain.o: SQMain.c SQMain.h SQFuncs.h
$(CXX) $(CXXFLAGS) -c SQMain.c -o $@

SQFuncs.o: SQFuncs.c SQFuncs.h
$(CXX) $(CXXFLAGS) -c SQFuncs.c -o $@

clean:
rm -f $(SDK_objs)

There error the server throws is a generic error which holds no use.

Any advice or support is appreciated.



Offline SugarD

  • Hero
  • ****
    • Posts: 11515
    With us since: 21/03/2008
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Reply #1 on: October 23, 2014, 11:24:49 am
Did you ever get this resolved?



Offline TeddyTopic starter

  • Orc
  • *****
    • Posts: 9161
  • "I'm on top of the world because of you."
  • With us since: 05/02/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Reply #2 on: October 23, 2014, 08:48:08 pm
You have access to the LU git... DOES IT LOOK RESOLVED?



Offline SugarD

  • Hero
  • ****
    • Posts: 11515
    With us since: 21/03/2008
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Reply #3 on: October 24, 2014, 04:31:41 pm
You have access to the LU git... DOES IT LOOK RESOLVED?
Well considering it doesn't say anything about where, NO.



 


SimplePortal 2.3.7 © 2008-2025, SimplePortal