opentomb / OpenTomb

An open-source Tomb Raider 1-5 engine remake
http://opentomb.github.io/
GNU Lesser General Public License v3.0
1.38k stars 143 forks source link

Code::Block OpenAL #485

Closed ghost closed 6 years ago

ghost commented 6 years ago

when i add libz.a or zlib.lib in linked library and compile the project i have an error: zlib.h is missing.

i dont know, all file work fine but not zlib. Image 1 with Error: error1 Image2 with File Left (updated last version): error2_withfile_left

how to fix the zlib not found ? PS: i download the zlib file here (developer): http://gnuwin32.sourceforge.net/packages/zlib.htm

vvs- commented 6 years ago

Hrm... You need to add zlib.h to headers path as well, of course.

ghost commented 6 years ago

Fixed with this tutorial of adding SDL2 (similar work): FRENCH: http://www.supinfo.com/articles/single/649-comment-installer-sdl-20-codeblocks-windows TODO: Change this SDL2 (in tutorial) to last version, the version 2.0.3 is bugged !

ghost commented 6 years ago

Sorry but now after fixed all import i get: error1

vvs- commented 6 years ago

You should not compile headers, they must be included implicitly through their corresponding .c files.

ghost commented 6 years ago

Need to compile lib manual ? Not already compiled ? But this error is with FMV. Need to include fmv to compile & linker ?

vvs- commented 6 years ago

You did include bitstream.h as a source file in your project, didn't you? You should include it only as a header, not as a source.

ghost commented 6 years ago

I cant test it now, thanks for help, if i have other problem when compile i reopen it.

ghost commented 6 years ago

but look: source i have bitstream.h in header but not source.

TeslaRus commented 6 years ago

src updated: added include to bytestream.h

vvs- commented 6 years ago

@TeslaRus Thanks.

@TokyoSU If that's the case then why it's in the tab for compiled sources in that screenshot with error message? First of all you might have it both as a source and a header and this isn't visible in the screenshot. And the source files which include bitstream.h compile just fine. There is no reason why it should be compiled separately.

ghost commented 6 years ago

Thanks TeslaRus is fixed but now i have: fixed

EDIT: the opentomb-code.cbp is terribly old (missing file) and i import all (add file recursively) and selected OpenTomb folder.

TeslaRus commented 6 years ago

should be p->eof instead ->eof

vvs- commented 6 years ago

Yet again: you should not compile bytestream.h. TeslaRus just fixed some cosmetic issue which presently should not affect any real case. Your error seemingly stem from compiling bytestream.h separately. Please, check that it isn't included in sources section of the project. Better yet don't create Code::Blocks project file manually, try CMake instead, which is a preferred way.

TeslaRus commented 6 years ago

in file option (bytestream.h) uncheck "compilable" or something like that P.S. I use Netbeans IDE

vvs- commented 6 years ago

@TokyoSU BTW, the code in the above screenshot doesn't match the code in repository. Are you sure that you didn't change it accidentally?

ghost commented 6 years ago

@TeslaRus Netbeans is more compatible ?

@vvs- The folder of opentomb have already a code-block project, i just used it, but is terribly old. i removed bytestream.h of headers, and with TeslaRus have fixed the "->" EDIT: i have just regrouped in 1 line.

vvs- commented 6 years ago

That explains it. This obsolete project file should be removed from repository, then.

ghost commented 6 years ago

i have added basic lib with command: compiler and include & lib: library include i have missed a library ? now i have this error: error

EDIT: The SDL2 library is x32 or x64 ?

TeslaRus commented 6 years ago

yep C::B project files should be deleted... they are very old Netbeans works good for me (debug works fine) + it works on MSW and Linux (C::B crashes under Linux)

ghost commented 6 years ago

need to have linux now or just use netbeans ? i can have linux with windows but if i can have ng and opentomb opened is good too xD

@TeslaRus README.MD need to be updated because lua is implemented not a library EDIT: OpenAL are only .lib not .a

ghost commented 6 years ago

@TeslaRus You have C/C++ version or All ?

vvs- commented 6 years ago

@TokyoSU All your problems come from the missing SDL2. That'd explain everything above.

ghost commented 6 years ago

but if you look: compiler SDL2 is here

TeslaRus commented 6 years ago

GCC uses only .a libs; .lib for MS Visual Studio

ghost commented 6 years ago

EDIT: not fixed T.T

@TeslaRus i see but OpenAL have only .lib

ghost commented 6 years ago

SDL2 is here but on compile have: error

vvs- commented 6 years ago

You should have all libraries compiled by a compatible compiler.

Especially C++ use a non-standard ABI.

ghost commented 6 years ago

SDL2: https://www.libsdl.org/download-2.0.php ZLIB: http://gnuwin32.sourceforge.net/packages/zlib.htm PNG: http://gnuwin32.sourceforge.net/packages/libpng.htm

and all other is included with Code::Blocks WinGW compiler

EDIT: linker option is good ?: -lmingw32 -lpthread -lSDL2main -lSDL2.dll -lz

ghost commented 6 years ago

windows is very problematic ...

PS: @TeslaRus is possible to add sdl2, png, zlib directly to project like lua ?

vvs- commented 6 years ago

All libraries obtained separately from the compiler are not guaranteed to be built by the same compatible version.

And including all libraries in-tree will ruin its compilation and distribution under different OSes.

ghost commented 6 years ago

FIXED SDL2

ghost commented 6 years ago

FIXED