I can't seem to make my premake5.lua configuration to link against xcb.
I get undefined reference to "xcb_connect". So far I've tried (in premake5.lua):
libdirs {os.findlib("xcb")}
links {"xcb", "xcb-randr" }
Notice that os.findlib returns the same path for both xcb and xcb-randr.
I tried installing all sorts of packages, running pkg-config on both libs to see the required flags and also inspecting if the generated make file ones matched.
I don't know if it is related but I'm running Debian under wsl.
Maybe i'm missing something. Thanks for the help.
Related
I'm trying to work with Qt5, SoQt (Version 1.5.0) and Coin3D (3.1.3). I used instructions found on this website to install Coin3D. I tried to install SoQt as well (Instructions found here). I had to change those export commands a little bit:
export COINDIR="/usr/local/share"
I tried four different versions of the export INCLUDE since i'm clueless about its purpose and i am not sure if this is the reason for the errors i'm getting:
export INCLUDE="/usr/local/include:/usr/include/x86_64-linux-gnu/qt5/QtCore"
export INCLUDE="/usr/local/include:/usr/include/x86_64-linux-gnu/qt5"
export INCLUDE="/usr/include/x86_64-linux-gnu/qt5/QtCore"
export INCLUDE="/usr/include/x86_64-linux-gnu/qt5"
This is where errormessages appear: (Shorter summary below)
checking for QT4...
Could not gather the configure flags for Qt through pkg-config. Please
ensure that the qt pkg-config metadata .pc files, such as QtCore.pc,
exist on your system. In case the metadata .pc files are installed
into a non-default location verify that the PKG_CONFIG_PATH environment
variable points to the correct directory.
Further details in how to set the PKG_CONFIG_PATH environment variable
can be found in the pkg-config(1) man page.
checking whether the X11 miscellaneous utilities library is available... maybe
checking for cygpath... false
checking for moc... /usr/bin/moc
configure: WARNING: header file qglobal.h not found, can not compile Qtcode
configure: WARNING: QTDIR environment variable not set -- this might be an indication of a problem
Could not find any way to build against the Qt library. If you
are sure Qt is properly installed on your system, see the file
config.log to find out what went wrong.
One common way to solve this problem is to set up the environment
variable QTDIR to the base of the Qt installation directory. Or if it
was already set up, double check to see that it is pointing at the
correct directory.
Note that it is possible to override the combinations of Qt libraries
configure tries to link against by setting up the environment variable
CONFIG_QTLIBS. This might be necessary if you have installed the Qt
library in a manner that is not compatible with any of the known
configurations, for instance by changing the name of the library or
the Qt library having more dependencies on other libraries that we are
aware of.
If you for instance know the correct set of libraries to be qt304.lib,
qtmain.lib and gdi32.lib (this would be on an MSWindows system), then
set CONFIG_QTLIBS to the string ''-lqt304 -lqtmain -lgdi32'' before
re-running configure.
If you still can't get the configure script to detect the presence of
and how to use the Qt library, please mail the config.log file to
<coin-support#coin3d.org> and ask for help.
configure: error: aborting
I might be wrong but it seems like he is looking for Qt4 and not Qt5 because of
checking for QT4...
It also reads
configure: WARNING: header file qglobal.h not found, can not compile Qtcode
That's why i tried using qt5/QtCore instead of qt5 as path because there is a qglobal.h located within QtCore but it doesn't change anything.
Did anyone else face similar problems when setting up SoQt with Qt5 and can help me out?
Thanks in advance!
Those releases are very old (2012). Please grab the latest source of Coin from the CMake brach [1], and SoQt from [2]. Build with CMake. Also see this discussion [3] regarding high DPI support.
[1] https://bitbucket.org/Coin3D/coin/branch/CMake
[2] https://bitbucket.org/Coin3D/soqt/branch/default
[3] https://groups.google.com/forum/#!topic/coin3d-discuss/ipkSH08iFNk
I am trying to install QuantLib on my Mac running OSX 10.11.6. Installed Boost 1.59 via MacPorts and then followed these instructions.
I used these additional environment variables
./configure --with-boost-include=/opt/local/include/ \
--with-boost-lib=/opt/local/lib/ --prefix=/opt/local/ \
CXXFLAGS='-O2 -stdlib=libstdc++ -mmacosx-version-min=10.6' \
LDFLAGS='-stdlib=libstdc++ -mmacosx-version-min=10.6'
and then make && sudo make install.
However when I run the Bermuda Swaption test it gave me the same error described here.
Little premise: I don't know anything about C++. I need QuantLib to work on Python. So I read carefully the answer by SmallChess and tried to solve it by myself. As I read in his answer
You can't just compile BermudanSwaption.cpp and hope everything would be fine. You have to compile the entire QuantLib library and link with the generated library files. Please google "compiling and linking C++" for more information.
By far, the easiest way to make it happen on Mac is to do it with Xcode. You will need to create a new Xcode project, and import the entire Quantlib project files into it. Next, you will need to create a main() function. Xcode does the compiling and linking for your automatically.
This is what I exactly did:
created a new project in Xcode (version 8.2.1)(file/new project/Command Line Tool/"HelloWorld"/Documents/create)
selected Targets, Build Phases and Link Binary With Library. Added libQuantLib.0.dylib
set libstdc++(GNUC++ standard library) as C++ Standard Library in Build Settings
Modified Header Search Paths to include: /opt/local/include/, and Library Search Paths to include: /opt/local/lib
C++ Language Dialect is set on Compiler Default.
Dragged the ql folder onto the left window of the Xcode
Now, I managed to copy a simple code which includes the library and even if there are many warnings, it runs. Still when I run on the Terminal the command for the Bermuda Swaption test I get the same error. What am I doing wrong?
Additional info (may or may not be useful): if I change the C++ Standard Library setting on Xcode to libc++, I get on Xcode the same error I get when i try the Bermuda Swaption test (ld: symbol(s) not found for architecture x86_64).
Any help would be very much appreciated
Regards
EDIT: you can find a picture of the code at https://i.stack.imgur.com/1zhjO.png
I have been trying to use SFML in a CMake project, specifically the header SFML/Audio.hpp. I installed SMFL using Homebrew, and both the .dylib-files and the headers should be located correctly, in /usr/local/lib and /usr/local/include, respectively.
Now running CMake works fine, telling me that it has Found SFML 2.4.2 in /usr/local/include.
However, when compiling the project (using make), I get the following error:
/path/to/project.hpp:12:10: fatal error: 'SFML/Audio.hpp' file not found.
Does anyone know why this is happening?
Note: Compiling works fine for colleagues of mine using the same CMake- and source files on various Linux operating systems.
This sounds like you simply forgot to add SFML's include directory. On Linux, they probably install SFML to some system path where GCC (or Clang) look by default, so they don't need any additional CMake directives.
Luckily, fixing this is pretty simple.
Add the following line to your CMakeLists.txt somewhere before defining targets:
include_directories(${SFML_INCLUDE_DIR})
The variable SFML_INCLUDE_DIR is populated when you successfully call find_package(SFML...).
While you're at it, you might also want to ensure to link to the proper library files in the correct order:
target_link_libraries(myTargetName ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
Again, both variables are populated automatically.
I am trying to convert a c++ project from Windows to Debian by compiling everything again with Cmake.
I am not really use to work on Linux but I have managed to install everything properly.
This is the error:
/usr/bin/ld: ../shared/libshared.a(BigNumber.cpp.o): undefined reference to symbol 'BN_new##OPENSSL_1.0.2d'
//usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2: error adding symbols: DSO missing from command line
This actually seems like a common question but I don't know what to do with Cmake. I already saw few answers like:
DSO missing from command line
How do I tell CMake to link in a static library in the source directory?
How to add linker or compile flag in cmake file?
I am a bit confused, could you help me to understand what I need to do with Cmake please?
Thank you
It is hard to guess what may be going wrong without seeing the CMake file itself, but here are some possible solutions.
Based on the similar error in your first referenced answer (DSO missing from command line), it would seem you may have simply forgotten to link to the libcrypto.so.1.0.2 library (or perhaps missed the ssl library as well). In my experience, these are often used in tandem, so linking both may be what you need. Use the target_link_libraries command to link these libraries to your CMake target:
target_link_libraries(MyLib PRIVATE ssl crypto)
I've also seen cases where this error arises due to a mismatch in the OpenSSL versions. For example, OpenSSL version 1.1 may be installed on your machine, but the library or packages you are using require version 1.0.2 (as the error suggests). If this is the case, you can uninstall the current OpenSSL version (1.1) and install the older version (1.0.2):
apt-get purge libssl-dev
apt-get install libssl1.0-dev
The error you are getting is about a missing link for a function that was called in the BigNumber.cpp file.
What's is happening is that CMakeLists.txt is most likely missing a library in:
TARGET_LINK_LIBRARIES( youApp
library1
library2
)
PS: the order in which you call the libraries is also important to get the linker to work properly.
Using OSX and vim...
Downloaded SDL2 from the website, then moved the SDL2.framework into /Library/Frameworks/
Using tutorial code, and Makefile... SDL.h is not found.
Makefile: g++sdl-config --cflags --libssdltest.cpp -o sdltest
I've read numerous things about pointing the compiler to the framework, but everything I've tried doesn't seem to work, and I thought /Library/Frameworks/ was the default area for the compiler to look
Got it to work.
Getting this to work took multiple tries, but the root of the issue for each try was that most of the Tutorials I was looking at were for SDL1.2 when I was using SDL2.
This changed flags in the make file, directories to search in and other things. Interestingly, I could never get the compiler to see SDL.h when it was in the /Library/Frameworks/ directory. However using Macports to install SDL2 allowed me to point the compiler to where Macports installed SDL2 header files - /opt/local/include/SDL2
That seems to have done it for me
Thank you for your question, because I was having similar difficulties! There seems to be a dearth of detailed and helpful tutorials on how to install SDL2 using Macports.
I got it working! Here are the steps:
Visit this link to find the Macports package appropriate for your version of Mac OS X. Install the version you need, and once that is done, proceed to step 2.
https://www.macports.org/install.php
After installation is done, visit this link to find the SDL2 port.
https://www.macports.org/ports.php?by=name&substr=libsdl
The one I needed was the third from the top, called libsdl2. I will be providing the name for you so feel free to visit the link simply for your own edification.
Open the Terminal, and type sudo port install libsdl2. If all goes to plan, you should see it installing and updating. Once it is complete, you should have a functional installation of the SDL2 Header files, (ending in .h), Static Library files (ending in .a) and Dynamic Library files (which contain dylib). You may have to do some poking around in Finder to locate where it installed.
The advantage of this workaround is the ability to use SDL with other IDE's besides Xcode, Eclipse for instance. Whereas Xcode requires you to assign a path of /Library/Frameworks, this technique should allow you to use the IDE of your choosing.
The final step is going into your IDE and assigning the build paths to these newly installed and compiled SDL files. For instance, the paths for mine are /opt/local/include and /opt/local/lib. Be mindful of the fact that your path may differ from these, but these examples should give you an idea of where to look.
Hopefully this is helpful for somebody!