[x264-devel] Error in testing libx264.a

Michigaki michigaki at gmail.com
Wed Nov 29 09:34:04 CET 2006


hello,

we are having problems in compiling a 'slightly' altered x264. We are always
receiving a 'helloWorld' undeclared (first use this function) error. We may
be commiting a very simple error but we just have to ask after looking
through possible solutions that have not worked.

So far, we are able to successfully compile the x263 source (an unaltered
one from the VideoLAN downloads section) using the instructions found at
www.mplayerhq.hu. So now, we are trying to see if we can really access the
library libx264.a using a method of ours which is adding a simple
int-returning function named hellowWorld().

We are currently using Dev-Cpp. Our project directory contains the files:

main.cpp
libx264.a
x264_test.dev

In Project -> project options -> parameters:
libx264.a

In Project -> project options -> directories:
Library directory: our project directory
Include directory: our project directory


As for the source codes, here is the code for main.cpp:
------------------
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <stdint.h>

int main(int argc, char *argv[])
{
    argc = helloWorld();
    system("PAUSE");
    return EXIT_SUCCESS;
}
------------------
Note: as we are coding main.cpp, it can see the int helloWorld() function
(through the autocomplete feature)

As i mentioned, we added a function named helloWorld() at the end of x264.c
------------------
...
static int close_file_mkv( hnd_t handle )
{
    ...
}

extern int helloWorld()
{
       return -1;
}
------------------

We added the helloWorld prototype in x264.h:
------------------
extern int helloWorld();
------------------

And so, we compiled x264 again and tried to use the new libx264.a in our
project. As we try to compile our own test project, we get the following
errors:

Compile Log:
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Michi and the
others\Desktop\x264-test\Makefile.win"
Executing  make...
make.exe -f "C:\Documents and Settings\Michi and the
others\Desktop\x264-test\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"
-I"C:/Dev-Cpp/include"  -I"C:/Documents and Settings/Michi and the
others/Desktop/x264-test"

main.cpp: In function `int main(int, char**)':

main.cpp:11: error: `helloWorld' undeclared (first use this function)
main.cpp:11: error: (Each undeclared identifier is reported only once for
each function it appears in.)

make.exe: *** [main.o] Error 1

Execution terminated


We are currently stuck at this problem.I hope anybody could help us.

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/x264-devel/attachments/20061129/27d2fb15/attachment.htm 


More information about the x264-devel mailing list