Hi guys hoping some of you solaris wizards might be able to point me in the right direction...
Background:
I'm compiling a program that makes use of some of the zfs CLI code. (found here: https://github.com/illumos/illumos-gate/tree/master/usr/src/cmd/zfs)
Problem:
libuutil.so.1 is present in /usr/lib but if I try to compile like so...
$ gcc -lzfs -L/usr/lib -luutil -lnvpair
ld: fatal: library -luutil: not found
Can anyone suggest a fix? Or a reason that the lib is not being found?
Thanks guys!
You need to link to a libuutil.so library. As explained in a post pointed to by Ben van Gompel and in this post:
https://blogs.oracle.com/mandalika/entry/quick_fix_to_the_linker
You'd need to do:
ln -s /usr/lib/libuutil.so.1 /usr/lib/libuutil.so
This is because ld looks only for names that end in .so, not in number. This is a simple mechanism to have many versions of one library (version being designated by the number at the end) that can be used by compilation process.
Related
I need to compile the rtree extension for SQLite from source code. The readme includes these instructions:
The easiest way to compile and use the RTREE extension is to build
and use it as a dynamically loadable SQLite extension. To do this
using gcc on *nix:
gcc -shared rtree.c -o libSqliteRtree.so
You may need to add "-I" flags so that gcc can find sqlite3ext.h
and sqlite3.h. The resulting shared lib, libSqliteRtree.so, may be
loaded into sqlite in the same way as any other dynamicly loadable
extension.
Problem I'm having is that I'm on Windows, not Linux, and so need to use MSVC. I tried:
cl rtree.c -link -out:libSqliteRtree.so
This gave cannot open include file errors until I found the various .h files it was complaining about and moved them into the same directory. Now, however, it's gotten to:
/out:rtree.exe
-out:libSqliteRtree.so
rtree.obj
Creating library libSqliteRtree.lib and object libSqliteRtree.exp
LINK : fatal error LNK1561: entry point must be defined
I admit I have pretty much zero clue what I'm doing in a compiler, and I'm not sure where to go from here to resolve its problem. Am I "translating" the compiler flags correctly from GCC to MSVC? What else can I tweak to try to get the SQLite extension out of the source code? Should I beg a favor from a developer on ateam with a Linux server and ask them to do it for me?
Thanks to Shawn for commenting to look at the SQLite Run-Time Loadable Extensions documentation, which had more information in it:
To compile on Windows using MSVC, a command similar to the following will usually work:
cl YourCode.c -link -dll -out:YourCode.dll
So for my situation: cl rtree.c -link -dll -out:libSqliteRtree.dll worked.
I receive errors on missing boost files but to my knowledge I already have them installed by YAST (OpenSUSE). However, I still receive the error. I need help fixing this problem.
When installation from YAST package did not work, I installed boost from source code. It still did not work. I installed boost-1.70.0
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_date_time
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_filesystem
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_system
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_regex
collect2: error: ld returned 1 exit status
make: *** [/home/hafiz/OpenFOAM/OpenFOAM-6/wmake/makefiles/general:142: /home/hafiz/OpenFOAM/hafiz-6/platforms/linux64GccDPInt64Opt/bin/laminarBuoyantSimpleSMOKE] Error 1
I would expect by installation of boost by source code, this error would get resolved but yet it's still there. boost compilation was successful as mentioned here:
...updated 184 targets...
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/hafiz/Softwares/boost/boost_1_70_0
The following directory should be added to linker library paths:
/home/hafiz/Softwares/boost/boost_1_70_0/stage/lib
I'm not sure if compiler include paths and linker library paths are automatically added though. Please help resolve this issue! Thanks
It seems like you're using OpenFOAM and OpenSMOKE++ so you've left out a lot of important information to actually answer this question (e.g. OpenFOAM uses wmake and not make explicitly!). Despite this, I'm going to answer assuming you (1) have OpenFOAM installed already, (2) are compiling OpenSMOKE++ applications/solvers, and (3) your only problem is that wmake can't find boost that you've installed.
You need to add the boost paths to your (solver)/Make/files EXE_LIBS section for wmake to find boost:
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfvOptions \
-L$(BOOST_LIB_DIR)
Where BOOST_LIB_DIR is an environmental variable set to /home/hafiz/Softwares/boost/boost_1_70_0/stage/lib
For more information, see the OpenFOAM User Guide Section 3.2: Compiling Applications and Libraries https://cfd.direct/openfoam/user-guide/v6-compiling-applications/#x10-710003.2
Also, stackoverflow isn't the best place for OpenFOAM -- cfd-online.com has a CFD/OpenFOAM specific forum better suited to questions like this.
I'm using gcc (GCC) 4.5.4 20120510 for GNAT GPL 2012 (20120509)
and qtada from qtada-gpl-3.2.0-20120708-3871-qt4.8.2-2.exe installer.
I'm trying to compile example from "..\GNAT\2012\examples\qtada\sql\cached_table", but it say "table_editors-moc.ads not found",
The error came from statement :
with Table_Editors.MOC; pragma Warnings (Off, Table_Editors.MOC);
-- Child package MOC must be included in the executable.
Where can i found the "Child package MOC" that contains "table_editors-moc.ads" and another moc file??
I don't know Qt or QtAda, but a quick search indicates that Qt uses a Meta Object Compiler (MOC) to auto-generate source code from macros. Could it be that your Table_Editor.MOC is supposed to be generated?
I'm surprised that QtAda has installed its examples at \GNAT\2012\examples; judging by the way GNAT is set up on this Mac, I'd have expected \GNAT\2012\share\examples.
However .. I suspect that QtAda's file system layout is complicated enough that you'll need to use a "GNAT Project file" to do the build. I hope there's a .gpr file in the same directory as your example code (if not, I can't help); if so, and assuming it's called cached_table.gpr, then in a command window say
gnatmake -p -P cached_table.gpr
or (following the documentation for QtAda 3.1)
gprbuild -p -P cached_table.gpr
Trying to get GtkAda to work. Didn't compile the lib myself, had a lot of problems and finally I found a precompiled library on the internet. Of course GPS didn't find it even after adding it to my path...
So I added it manually to my project and GPS began the compilation. It is just a simple example to see if everything works. Just beginning to learn programming.
WITH Gtk.Main ;
USE Gtk.Main ;
WITH Gtk.Window ;
USE Gtk.Window ;
WITH Gtk.Enums ;
USE Gtk.Enums ;
PROCEDURE MaFenetre IS
win : Gtk_window ;
BEGIN
Init ;
Gtk_New(win,Window_Popup) ;
win.show ;
Main ;
END MaFenetre ;
Which gave me this error:
gnatlink /Users/laurentlutgen/GPS/mafenetre.ali -o
/Users/laurentlutgen/GPS/mafenetre
Undefined symbols for architecture x86_64:
"_ada_c_enum_value_size", referenced from:
.
.
.
"_pango_tab_array_new", referenced from:
pango_tabs__pango_new in pango-tabs.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit
status gnatlink: error when calling /usr/local/gnat/bin/gcc
gnatmake: * link failed.
[2013-08-01 21:16:46] process exited with
status 4 (elapsed time: 09.38s)
The list of files the compiler complains about is quite long so.
Anyone an idea how to solve this.
I use the last version of gnat (2013) from AdaCore for MacOS X. I use MacOS 10.8.
The GtkAda library is xadalib 2012.
Thanks
Laurent
From what I see, gnatlink does not get passed the libraries needed to link against. You said that you added GtkAda to your project manually. By doing this, you probably missed all the linker options specified in the *.gpr file of GtkAda, so your binary does not get linked against the GTK+ library.
I suggest you try to get GPS to find the installed GtkAda project file. You can do this by setting ADA_PROJECT_PATH before launching GPS. If GtkAda is located in GNAT GPL's default path, it looks like this:
$ export ADA_PROJECT_PATH="/usr/local/gnat/lib/gnat"
$ gps
You said you're using a precompiled binary you found on the internet. Are you aware that GtkAda is bundled with the GNAT GPL compiler? You should use that, unless you want to use gtk-quartz as backend (which doesn't require X11). If that's the case, you may find the instructions I wrote for compiling GPS with gtk-quartz helpful (as Simon already noted).
If you want, you can try my GPS port to OSX. By default, it is able to load the *.gpr files bundled with GNAT GPL. On the Usage page, you find instructions of how to change the ADA_PROJECT_PATH if you installed your GNAT somewhere else.
For further help, you should post the *.gpr file of your project.
Edit:
I stand corrected: GtkAda is in fact not included in the GNAT GPL distribution for whatever reason. As XmlAda is included as project to link against, I was sure GtkAda was too, but it isn't; so using XAdaLib seems to be the easiest option. You have to point ADA_PROJECT_PATH to the installation directory of XAdaLib instead of the usual GNAT one to be able to use GtkAda.
As far as I know none of the GPL'ed GNATs from AdaCore for x86 have the capability to generate 64-bit code. I think I read something to that effect somewhere but cannot remember where.
The issue also came up in the Ada-port of Doom3, so if you can find him he might know for sure.
OK, I'm new to compiling programs, and I have literally tried everything.
I downloaded System.Data.SQLite from here:
http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
This allowed me to get sqlite functionality into my C# application. Now I'm looking to add a Levenshtein function so that I can do a search to find similar results in my c# application.
I stumbled upon:
https://github.com/mateusza/SQLite-Levenshtein
But I honestly have no clue how to compile it and load it as an extension. I read about the sqlite extensions on sqlite's main website.
I have an idea about how to load my extension: Run select load_extension('path to .dll'), but I don't know how to turn that SQLite-Levenshtein into a dll file that can be loaded from sqlite. I would appreciate any help you can give. (Please bear with me, I'm slowly diving into wide world of compiling).
That's how I compiled this extension with mingw GCC:
gcc -s -O4 -I /path/to/sqlite/headers/ -shared -o levenshtein.dll levenshtein.c
/path/to/sqlite/headers/ is the place where sqlite3ext.h file is located.
If your platform is x86 (32-bit), you may take http://www.siftsoft.com/misc/levenshtein.dll -- that's what I built from git HEAD right now.