I'm currently working on a AAC Decoder on Windows using Microsoft Media Foundation. I'm using the Source Reader and it's method MFCreateSourceReaderFromByteStream. When I compile I get following error:
undefined reference to `MFCreateSourceReaderFromByteStream#12'
This is how my Makefile looks like under LIBS:
LIBS = -lpthread -lFLAC-8 -lFLAC++-6 -lOpenAl32 -lm -lcurl-4 -lole32 -lmfplat
What other libs do I need to include?
Compiler used: mingw32 gcc
Thanks
The docs show clearly that you need to link to Mfreadwrite.lib
Related
I'm trying to compile the code found in https://www.glfw.org/documentation. This code is in "main.cpp" and I have a folder in the same directory called "dependencies" containing: "glfw3.h", "glfw3.lib" and "libglfw3.a".
project directory
dependencies
I go to the directory in powershell and run:
g++ main.cpp -ldependencies .\dependencies\libglfw3.a -lopengl32 -lgdi32
and it returns:
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldependencies: No such file or directory
collect2.exe: error: ld returned 1 exit status
What have I done wrong?
I've looked all the internet for solutions but none have worked even when I exactly do what is shown on the tutorial or solution, im quite stuck. I think its because im attempting to do this without an IDE (I used visual studio) and until recently i've only did C++ development with an IDE and i'm inexperienced with compiling and linking outside of IDE's.
g++ main.cpp -ldependencies .\dependencies\libglfw3.a -lopengl32 -lgdi32
should be
g++ main.cpp -Ldependencies -lglfw3 -lopengl32 -lgdi32
-L for a directory to search, -l for the name of the library to link with.
I'm trying to use std::map in ESP8266 firmware developing with Sming 2.1.0 (on Windows 7 SP1) .
I've got following error:
undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
According to this http://www.esp8266.com/viewtopic.php?p=40593 and this ESP8266 for Arduino IDE (xtensa-lx106-elf-gcc) and std::map linking error one should add -lstdc++ (and potentially -lsupc++) to the list of libraries to link with.
But in Makefile-project.mk in Sming there is -nostdlib flag!
LDFLAGS = -nostdlib ...
If I change it to -lstdc++ -lsupc++ I've got those errors instead:
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: cannot find crt1-sim.o: No such file or directory
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: cannot find _vectors.o: No such file or directory
And to solve this here https://www.reddit.com/r/esp8266/comments/3pmyx8/trying_to_link_but_getting_weird_errors/ recommended following:
Try using the -nostdlib link option.
Brilliant!
I've tried to use xtensa-lx106-elf from arduino-esp8266
https://github.com/rogerclarkmelbourne/arduino-esp8266/tree/master/tools/xtensa-lx106-elf (it includes crt1-sim.o, _vectors.o and others libs) but it not help.
I haven't find final answer: "If there a way to use std::map and so on in Sming?"
Thanks in advance for help.
Build it after all. In the end it was simple.
I should add stdc++ supc++ to LIBS not to LDFLAGS
That is:
LIBS = stdc++ supc++ microc ...
And remain LDFLAGS the same (with -nostdlib)
LDFLAGS = -nostdlib ...
I'm making a code in C++ that shoudl use a library that is called Concorde to solve a well known problem called Traveling Salesman Problem. This library is available here
I've compiled by first running ./configure --with-cplex=<CPLEX_DIR> and then make resulting in two main files concorde.a and concorde.h. In this way concorde is configure to run and use IBM Cplex as the exact solver.
I'm using Code::Blocks as IDE and in the build options I've added the library (concorde.a) under Link libraries and included the header in my code.
However when I try to compile my code, it gives me and error indicating that it can't find the implementation of the concorde functions that I call and that are defined in the concorde.h file. In this case the error is "undefined reference to <function>".
Can anyone help me with that?
The last part of the build log of codeblocks is the following:
g++ -L/opt/ibm/ILOG/CPLEX_Studio1251/cplex/lib/x86-64_sles10_4.1/static_pic
-L/opt/ibm/ILOG/CPLEX_Studio1251/concert/lib/x86-64_sles10_4.1/static_pic
-L/opt/concorde -o bin/Debug/SVRPDSP obj/Debug/instance.o obj/Debug/lib/combo.o
obj/Debug/lib/IncumbentCallback2C.o obj/Debug/lib/lazyCallback2C.o
obj/Debug/lib/lazyCallbackGLS.o obj/Debug/lib/lib_algorithms.o
obj/Debug/lib/lib_general.o obj/Debug/solution.o -lrt -lilocplex -lcplex
-lconcert -lm -lpthread /opt/concorde/concorde.a
ps: I'm compiling on Ubuntu 13.10
Thanks.
First of all: Concorde does not support CPLEX 12.5.
I have downloaded QSopt and launched ./configure --with-qsopt=QSOPT_DIR.
Finally, the order of the libs is the following:
-lilocplex -lconcert -lcplex /opt/concorde/concorde.a /opt/QS/qsopt.a -lm -lpthread
I am trying to use amalgamated version of sqlite3.c and sqlite3.h in my C/C++ project. It has code in both C and C++. I am using eclipse IDE in UBUNTU 12.04.
Now my problem is that after having include sqlite3.h in my file where I need sqlite3.c functions and having added ld and pthread libraries in linker, i am still getting errors and cant build the project.
This is weird and should not happen. Please take a look at following screenshots that explain my problem.
************************************************************************************
************************************************************************************
What am I missing?
Please Help!
Thanks
Make sure that the pthread library is linked before the dl library.
In other words, your compiler command (as generated by Eclipse) should be:
gcc shell.c sqlite3.c -lpthread -ldl
and not
gcc shell.c sqlite3.c -ldl -lpthread
See here for a correct command line:
http://www.sqlite.org/howtocompile.html
I looked at this post, but it did not help. Builder returns me this:
/cygdrive/c/Users/Itun/workspace/VoxEngine/Debug/../src/main.cpp:30: undefined reference to _glEnable
/cygdrive/c/Users/Itun/workspace/VoxEngine/Debug/../src/main.cpp:31: undefined reference to _glClearColor'`.
What do -lglut32 -lglu32 -lopengl32 flags mean? Where are the libs?
How to create OpenGL project under Cygwin with Eclipse?
UPDATE:
I add -I/usr/include/opengl to g++ and it starts to work. In this folder there is a single file GL.dll. How does this dll influence to the compilation?
The flag -l -lglut32 -lglu32 -lopengl32 tell the linker to link against libraries libglut32, libglu32 and libopengl32
However your error indicated you didn't include any OpenGL header files. (#include <GL/gl.h>, #include <GL/glu.h>)
Cygwin keeps to the Unix way and places libraries in $CYGWINPREFIX/usr/lib and includes in $CYGWINPREFIX/usr/include.