Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » how to compile source files and create shared lib.
how to compile source files and create shared lib. [message #44640] Mon, 04 May 2015 04:26 Go to next message
mtdew3q is currently offline  mtdew3q
Messages: 145
Registered: July 2010
Location: Upstate, NY
Experienced Member
HI-

I am trying to find an example to compile like this (any links I can read please?) I can check syntax in IDE but then have to go outside IDE
to make shared file. I put my .cpp, .h, in upp package directory by including
them. There are 20 or so .cpp files. I am compiling and building IBPP
for firebird. It links inside upp with message 'ok'. Any cool tips are appreciated!

CC = g++

CFLAGS = -fPIC -pedantic -Wall -shared
DEBUGFLAGS = -O0 -DIBPP_LINUX -DIBPP_GCC -std=c++11


INCLUDES = -I../ibpp_headers

LFLAGS = -L../fb_libs -L/usr/lib/x86_64-linux-gnu
LIBS = -lfbclient -lm -lpthread -lcrypt

SRCS = array.cpp blob.cpp database.cpp date.cpp dbkey.cpp \
_dpb.cpp events.cpp exception.cpp _ibpp.cpp _ibs.cpp \
_rb.cpp row.cpp service.cpp _spb.cpp statement.cpp \
time.cpp _tpb.cpp transaction.cpp user.cpp \


OBJS = $(SRCS:.c=.o)
TARGET = sqlFB.so

all: $(TARGET)

$(TARGET): $(OBJS)
$(CC) $(CFLAGS) $(DEBUGFLAGS) $(INCLUDES) -o $(TARGET) $(OBJS) $(LFLAGS) $(LIBS)


.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

clean:
$(RM) *.o *~ $(TARGET)

depend: $(SRCS)
makedepend $(INCLUDES) $^

# DO NOT DELETE THIS LINE -- make depend needs it
Re: how to compile source files and create shared lib. [message #44641 is a reply to message #44640] Mon, 04 May 2015 04:37 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 145
Registered: July 2010
Location: Upstate, NY
Experienced Member
Hi-

I am going to look at umk first.

thanks
Re: how to compile source files and create shared lib. [message #44642 is a reply to message #44640] Mon, 04 May 2015 05:25 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 145
Registered: July 2010
Location: Upstate, NY
Experienced Member
I am glad I can use synaptic and read it. Umk was going to try to wipe out theIDE. I can't find out how to build a shared library file in U++. I will search a little more but not too much longer. I hoped to do everything from within the IDE. Not sure if it can be done "by me".

thanks
Re: how to compile source files and create shared lib. [message #44643 is a reply to message #44642] Mon, 04 May 2015 05:40 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 145
Registered: July 2010
Location: Upstate, NY
Experienced Member
Hi-

Does anyone know the syntax to run a makefile in custom build? Can you give a minimalist example is possible?

thanks!
Re: how to compile source files and create shared lib. [message #44644 is a reply to message #44640] Mon, 04 May 2015 06:29 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1758
Registered: August 2008
Location: Czech Republic
Senior Contributor

Hi mtdew3q,


Quote:
I am glad I can use synaptic and read it. Umk was going to try to wipe out theIDE.
This is because umk is also in the package called theide, you should already have it installed.

Now, to the problem itself. Are you trying to create a U++ package for IBPP? Did you check the Firebird package in bazaar? It might save you some trouble, if you just need this to access firebird...

There are two ways you can use to run custom code from TheIDE. If it is ok to run them manually, you can use macros. If you need it as automatic part of the build process, then there are the custom build steps, You'll probably need to create the shared object in "pre-link" phase.

Best regards,
Honza
Re: how to compile source files and create shared lib. [message #44645 is a reply to message #44644] Mon, 04 May 2015 07:13 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 145
Registered: July 2010
Location: Upstate, NY
Experienced Member
Hi-

I followed the link to the macro. I kind of get the mini scripting language. I couldn't figure out after I create the macro where to put the .usc file and how to execute it though.

Where is the common or local directory? I think they are bound to a key combination... right?

For i.e. this code goes in .usc file but how to execute it? Thanks for elaborating!

macro "Insert current date" {
s = [];
tm = GetSysTime();
s << to_string(tm.year) << "-" << to_string(tm.month) << "-" << to_string(tm.day);
.Insert(s);
}
Re: how to compile source files and create shared lib. [message #44646 is a reply to message #44640] Mon, 04 May 2015 07:29 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 145
Registered: July 2010
Location: Upstate, NY
Experienced Member
I just found in editor mode where to put the path.

thanks for helping!
Re: how to compile source files and create shared lib. [message #44647 is a reply to message #44645] Mon, 04 May 2015 07:41 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1758
Registered: August 2008
Location: Czech Republic
Senior Contributor

mtdew3q wrote on Mon, 04 May 2015 07:13
Hi-

I followed the link to the macro. I kind of get the mini scripting language. I couldn't figure out after I create the macro where to put the .usc file and how to execute it though.

Where is the common or local directory? I think they are bound to a key combination... right?

Just put the *.usc file in your pacakge.

You can bind a keyboard shortcut to the macro, or you can execute it via Macro menu, which appears in theide as soon as you have any package containing usc file in your project.

Honza
Re: how to compile source files and create shared lib. [message #44648 is a reply to message #44640] Mon, 04 May 2015 07:56 Go to previous message
mtdew3q is currently offline  mtdew3q
Messages: 145
Registered: July 2010
Location: Upstate, NY
Experienced Member
okay-

that works really cool.

THANKS Honza Cool
Previous Topic: How to compile non C/C++ files in an U++ project
Next Topic: Debugging mouse over popup need to be improved
Goto Forum:
  


Current Time: Tue Dec 10 23:20:53 CET 2019

Total time taken to generate the page: 0.00917 seconds