I'm having difficulty building a project in Windows 7 / Visual Studio 2010, and already spent longer than I would admit googling and fixing other errors to get to this point, but frustratingly I can't seem to get rid of the very last error. There is a linker error related to the _hypot function defined in math.h:
wxTheAppInitializer" (?wxTheAppInitializer##3VwxAppInitializer##A)
already defined in main.obj 1>libgsl.a(linalg_svd.o) : error LNK2019:
unresolved external symbol _hypot referenced in function
_gsl_linalg_SV_decomp 1>libgsl.a(matrix_oper.o) : error LNK2001: unresolved external symbol _hypot 1>libgsl.a(linalg_householder.o) :
error LNK2001: unresolved external symbol _hypot
: fatal error LNK1120: 1 unresolved externals
When I follow the advice of unresolved external symbol "_hypot" when using static library I get the following:
1> Generating Code... 1> main.obj : error LNK2005: _hypot already
defined in About.obj 1> fatal error LNK1169: one or more multiply
defined symbols found
Could anyone explain what is going on?
Create .c file with the following contents:
extern double fabs(double);
extern double sqrt(double);
double hypot(double x, double y) {
double ax = fabs(x), ay = fabs(y);
double xy = x/y, yx = y/x;
return ax > ay
? ax * sqrt(1.0 + yx*yx)
: ay * sqrt(1.0 + xy*xy);
}
do not include math.h
Related
I'm creating an app to test an api func IsCharLowerA and then output res using MessageBoxA. I'm using masm32.
link /SUBSYSTEM:WINDOWS kod.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
kod.obj : warning LNK4033: converting object format from OMF to COFF
kod.obj : error LNK2001: unresolved external symbol __ExitProcess#4
kod.obj : error LNK2001: unresolved external symbol __MessageBoxA#16
kod.obj : error LNK2001: unresolved external symbol __imp__printf
kod.obj : error LNK2001: unresolved external symbol __imp__scanf
kod.obj : error LNK2001: unresolved external symbol _IsCharLowerA#4
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
ml kod.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: kod.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"kod.obj"
"kod.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
kod.obj : warning LNK4033: converting object format from OMF to COFF
LINK : fatal error LNK1181: cannot open input file "kod.exe"
I've tried to use microsoft masm32 (to compile code in visual studio), but when the app starts it's only ask for a char and then closes. I could not try to debug due to "source not available" error.
Some code:
.586
.model flat, stdcall
option casemap: none
include C:\masm32\include\windows.inc
include C:\masm32\include\kernel32.inc
include C:\masm32\include\user32.inc
include C:\masm32\include\msvcrt.inc
includelib C:\masm32\lib\msvcrt.lib
includelib C:\masm32\lib\kernel32.lib
includelib C:\masm32\lib\user32.lib
.data
msg db 'Enter char: ', 0
messagebox_title db ' Лабораторна робота № 5 ', 0
result_0 db ' NOT LOWERCASE ', 0
result_1 db ' LOWERCASE ', 0
scan_modifier db '%c', 0
.data?
scan_res dd ?
.code
start:
push ebp
mov ebp, esp
invoke crt_printf, OFFSET msg
invoke crt_scanf, OFFSET scan_modifier, scan_res
push scan_res
call IsCharLowerA
push 0
push offset messagebox_title
cmp eax, 0
jne notNULL
push offset result_0
jmp next
notNULL:
push offset result_1
next:
push 0
call MessageBoxA
push 0
call ExitProcess
pop ebp
end start
Update #1: (changed MessageBoxA -> MessageBoxA#16 and others)
Code:
.586
.model flat, stdcall
option casemap: none
include C:\masm32\include\windows.inc
include C:\masm32\include\kernel32.inc
include C:\masm32\include\user32.inc
include C:\masm32\include\msvcrt.inc
includelib C:\masm32\lib\msvcrt.lib
includelib C:\masm32\lib\kernel32.lib
includelib C:\masm32\lib\user32.lib
extrn MessageBoxA#16 : PROC
extrn ExitProcess#4 : PROC
.data
msg db 'Enter char: ', 0
messagebox_title db ' Лабораторна робота № 5 ', 0
result_0 db ' NOT LOWERCASE ', 0
result_1 db ' LOWERCASE ', 0
scan_modifier db '%c', 0
.data?
scan_res dd ?
.code
start:
push ebp
mov ebp, esp
invoke crt_printf, OFFSET msg
invoke crt_scanf, OFFSET scan_modifier, scan_res
push scan_res
call IsCharLowerA
push 0
push offset messagebox_title
cmp eax, 0
jne notNULL
push offset result_0
jmp next
notNULL:
push offset result_1
next:
push 0
call MessageBoxA#16
push 0
call ExitProcess#4
pop ebp
end start
Res:
link /SUBSYSTEM:WINDOWS kod.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
kod.obj : warning LNK4033: converting object format from OMF to COFF
kod.obj : error LNK2001: unresolved external symbol _MessageBoxA#16
kod.obj : error LNK2001: unresolved external symbol __imp__printf
kod.obj : error LNK2001: unresolved external symbol _ExitProcess#4
kod.obj : error LNK2001: unresolved external symbol __imp__scanf
kod.obj : error LNK2001: unresolved external symbol _IsCharLowerA#4
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
kod.exe : fatal error LNK1120: 6 unresolved externals
I have a code error LNK2001: unresolved external symbol _MessageBox (uploaded #2 "Final working code") is not succeed linking too
The problems was:
1) For scanf needed OFFSET scan_res, because not value is needed.
2) Can not be compiled using both windows and console subsystem. That's why i used only printfs.
3) Was not enough library msvcrt.
4) Сonverting from OMF to COFF could be ignored.
Working code:
.586
.model flat, stdcall
option casemap: none
include C:\masm32\include\windows.inc
include C:\masm32\include\user32.inc
include C:\masm32\include\msvcrt.inc
includelib C:\masm32\lib\msvcrt.lib
includelib C:\masm32\lib\user32.lib
.data
msg db 'Enter char: ', 0
result_0 db ' NOT LOWERCASE ', 0
result_1 db ' LOWERCASE ', 0
scan_modifier db '%c', 0
.data?
scan_res dd ?
.code
start:
mov ebp, esp
invoke crt_printf, OFFSET msg
invoke crt_scanf, OFFSET scan_modifier, OFFSET scan_res
push scan_res
call IsCharLowerA
cmp eax, 0
jne notNULL
invoke crt_printf, OFFSET result_0
jmp next
notNULL:
invoke crt_printf, OFFSET result_1
next:
ret
end start
I am trying to install aruco on my Windows machine using cmake 3.5.2 as suggested by the aruco developper.
My config:
Windows8
CMake 3.5.2
ArUco 2.0.5
I can configure and generate successfully aruco in cmake.
Then I go to aruco\build -> right click-> open cmd -> type mingw32-make -> get the following error:
C:\aruco-2.0.5\build>mingw32-make
Scanning dependencies of target aruco
[ 2%] Building CXX object src/CMakeFiles/aruco.dir/ar_omp.cpp.obj
[ 4%] Building CXX object src/CMakeFiles/aruco.dir/cameraparameters.cpp.obj
[ 6%] Building CXX object src/CMakeFiles/aruco.dir/cvdrawingutils.cpp.obj
In file included from C:\aruco-2.0.5\src\aruco.h:149:0,
from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markerdetector.h:160:40: warning: "/*" within comment [-Wcomm
ent]
ARUCO_MIP_36h12, //**** recommended
^
C:\aruco-2.0.5\src\markerdetector.h:212:60: warning: unused parameter 'r2' [-Wun
used-parameter]
void setThresholdParamRange(size_t r1 = 0, size_t r2 = 0) {_params. _thresP
aram1_range = r1; }
^
C:\aruco-2.0.5\src\markerdetector.h:267:30: warning: unused parameter 'val' [-Wu
nused-parameter]
void setDesiredSpeed(int val){}
^
In file included from C:\aruco-2.0.5\src\posetracker.h:33:0,
from C:\aruco-2.0.5\src\aruco.h:150,
from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::to
Stream(std::ostream&)':
C:\aruco-2.0.5\src\markermap.h:49:77: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void toStream(std::ostream &str){str<<id<<" "<<size()<<" ";for(int i=0;i<si
ze();i++) str<<at(i).x<<" "<<at(i).y<<" "<<at(i).z<<" ";}
^
In file included from C:\aruco-2.0.5\src\posetracker.h:33:0,
from C:\aruco-2.0.5\src\aruco.h:150,
from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::fr
omStream(std::istream&)':
C:\aruco-2.0.5\src\markermap.h:50:80: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void fromStream(std::istream &str){int s;str>>id>>s;resize(s);for(int i=0;i
<size();i++) str>>at(i).x>>at(i).y>>at(i).z;}
^
[ 9%] Building CXX object src/CMakeFiles/aruco.dir/dictionary.cpp.obj
In file included from C:\aruco-2.0.5\src\dictionary.cpp:9:0:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::to
Stream(std::ostream&)':
C:\aruco-2.0.5\src\markermap.h:49:77: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void toStream(std::ostream &str){str<<id<<" "<<size()<<" ";for(int i=0;i<si
ze();i++) str<<at(i).x<<" "<<at(i).y<<" "<<at(i).z<<" ";}
^
In file included from C:\aruco-2.0.5\src\dictionary.cpp:9:0:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::fr
omStream(std::istream&)':
C:\aruco-2.0.5\src\markermap.h:50:80: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void fromStream(std::istream &str){int s;str>>id>>s;resize(s);for(int i=0;i
<size();i++) str>>at(i).x>>at(i).y>>at(i).z;}
^
C:\aruco-2.0.5\src\dictionary.cpp: In static member function 'static std::string
aruco::Dictionary::getTypeString(aruco::Dictionary::DICT_TYPES)':
C:\aruco-2.0.5\src\dictionary.cpp:236:11: warning: enumeration value 'ARTAG' not
handled in switch [-Wswitch]
switch(t){
^
C:\aruco-2.0.5\src\dictionary.cpp: In member function 'aruco::MarkerMap aruco::D
ictionary::createMarkerMap(cv::Size, int, int, const std::vector<int>&, bool)':
C:\aruco-2.0.5\src\dictionary.cpp:275:39: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (gridSize.height*gridSize.width!=ids.size())throw cv::Exception(9001, "g
ridSize != ids.size()Invalid ", "Dictionary::createMarkerMap", __FILE__, __LINE_
_);
^
C:\aruco-2.0.5\src\dictionary.cpp:284:23: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (int i=0;i<ids.size();i++) TInfo[i].id=ids[i];
^
C:\aruco-2.0.5\src\dictionary.cpp:285:13: warning: unused variable 'sizeY' [-Wun
used-variable]
int sizeY=gridSize.height*MarkerSize+(gridSize.height-1)*MarkerDistance
;
^
C:\aruco-2.0.5\src\dictionary.cpp:286:13: warning: unused variable 'sizeX' [-Wun
used-variable]
int sizeX=gridSize.width*MarkerSize+(gridSize.width-1)*MarkerDistance;
^
C:\aruco-2.0.5\src\dictionary.cpp:312:37: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (CurMarkerIdx>=ids.size()) throw cv::Exception(999," Fid
ucidalMarkers::createMarkerMapImage_ChessMarkerMap","INTERNAL ERROR. REWRITE THI
S!!",__FILE__,__LINE__);
^
C:\aruco-2.0.5\src\dictionary.cpp:300:13: warning: unused variable 'centerX' [-W
unused-variable]
int centerX=sizeX/2;
^
C:\aruco-2.0.5\src\dictionary.cpp:301:13: warning: unused variable 'centerY' [-W
unused-variable]
int centerY=sizeY/2;
^
C:\aruco-2.0.5\src\dictionary.cpp:303:14: warning: unused variable 'centerData'
[-Wunused-variable]
bool centerData=true;
^
[ 11%] Building CXX object src/CMakeFiles/aruco.dir/ippe.cpp.obj
C:\aruco-2.0.5\src\ippe.cpp: In function 'void IPPE::IPPComputeRotations(double,
double, double, double, double, double, cv::OutputArray, cv::OutputArray)':
C:\aruco-2.0.5\src\ippe.cpp:307:45: warning: variable 'ata10' set but not used [
-Wunused-but-set-variable]
double a00, a01, a10,a11, ata00, ata01, ata10,ata11,b00, b01, b10,b11,binv0
0, binv01, binv10,binv11;
^
C:\aruco-2.0.5\src\ippe.cpp:311:19: warning: variable 'a' set but not used [-Wun
used-but-set-variable]
double b0, b1,a,gamma,dtinv;
^
[ 13%] Building CXX object src/CMakeFiles/aruco.dir/marker.cpp.obj
C:\aruco-2.0.5\src\marker.cpp: In member function 'void aruco::Marker::rotateXAx
is(cv::Mat&)':
C:\aruco-2.0.5\src\marker.cpp:299:22: error: 'M_PI' was not declared in this sco
pe
float angleRad = M_PI / 2;
^
src\CMakeFiles\aruco.dir\build.make:187: recipe for target 'src/CMakeFiles/aruco
.dir/marker.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/aruco.dir/marker.cpp.obj] Error 1
CMakeFiles\Makefile2:116: recipe for target 'src/CMakeFiles/aruco.dir/all' faile
d
mingw32-make[1]: *** [src/CMakeFiles/aruco.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
C:\aruco-2.0.5\build>mingw32-make
Scanning dependencies of target aruco
[ 2%] Building CXX object src/CMakeFiles/aruco.dir/marker.cpp.obj
C:\aruco-2.0.5\src\marker.cpp: In member function 'void aruco::Marker::rotateXAx
is(cv::Mat&)':
C:\aruco-2.0.5\src\marker.cpp:299:22: error: 'M_PI' was not declared in this sco
pe
float angleRad = M_PI / 2;
^
src\CMakeFiles\aruco.dir\build.make:187: recipe for target 'src/CMakeFiles/aruco
.dir/marker.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/aruco.dir/marker.cpp.obj] Error 1
CMakeFiles\Makefile2:116: recipe for target 'src/CMakeFiles/aruco.dir/all' faile
d
mingw32-make[1]: *** [src/CMakeFiles/aruco.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I have also tried to do it with codeblocks but I get the exact same error.
The developer has released a new version 2.0.7 fixing this issue.
What I have done to have aruco:
download the .zip on sourceforge
unzip it
create a build folder in aruco-2.0.7
open cmake-gui configure and generate
go into your build folder
open a cmd window from there
type mingw32-make
The library should have compiled properly.
If omp.h is missing from your compiler, find the source code on the internet and add it to mingw in MinGW\include. You should be ready to go. Don't forget to add aruco to your path & reboot.
If you are using an ide, you will have to add this library since it is an external library but it is another issue.
Finally, you might have some issues regarding c++11. I am working on it. If someone knows how to allow it on mingw (I haven't find any understandable explanation so far)
I have a fortran subroutine, FortranShake, and a C++ main function, HandShakingTest.cpp.
I'm trying to call a fortran subroutine from CLR C++.
I'm getting two batches of errors. Let's call them ERROR(1) and ERROR(2). I'd really appreciate if you could help me understand why these errors are happening.
When I try to compile with the following:
cl /clr HandShakingTest.cpp
I get the following ERROR(1):
HandShakingTest.obj : error LNK2028: unresolved token (0A00030A) "extern "C" void __c
ecl FortranShake(int &)" (?FortranShake##$$J0YAXAAH#Z) referenced in function "int __
lrcall main(cli::array<class System::String ^ >^)" (?main##$$HYMHP$01AP$AAVString#Sys
em###Z)
HandShakingTest.obj : error LNK2019: unresolved external symbol "extern "C" void __cd
cl FortranShake(int &)" (?FortranShake##$$J0YAXAAH#Z) referenced in function "int __c
rcall main(cli::array<class System::String ^ >^)" (?main##$$HYMHP$01AP$AAVString#Syst
m###Z)
HandShakingTest.exe : fatal error LNK1120: 2 unresolved externals
I then used the following commands to compile instead:
ifort /c FortranShake.f //Which compiles fine
cl /c /clr HandShakingTest.cpp //compiles fine
cl /o test HandShakingTest.obj FortranShake.obj //ERROR(2) occurs
ERROR(2) consists of:
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(cla
ss type_info const &)" (??0type_info##AAE#ABV0##Z) already defined in LIBCMT.lib(typin
fo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_i
nfo::operator=(class type_info const &)" (??4type_info##AAEAAV0#ABV0##Z) already defin
ed in LIBCMT.lib(typinfo.obj)
MSVCRT.lib(merr.obj) : error LNK2005: __matherr already defined in LIBCMT.lib(_matherr
_.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NOD
EFAULTLIB:library
HandShakingTest.obj : error LNK2028: unresolved token (0A00030A) "extern "C" void __cd
ecl FortranShake(int &)" (?FortranShake##$$J0YAXAAH#Z) referenced in function "int __c
lrcall main(cli::array<class System::String ^ >^)" (?main##$$HYMHP$01AP$AAVString#Syst
em###Z)
HandShakingTest.obj : error LNK2019: unresolved external symbol "extern "C" void __cde
cl FortranShake(int &)" (?FortranShake##$$J0YAXAAH#Z) referenced in function "int __cl
rcall main(cli::array<class System::String ^ >^)" (?main##$$HYMHP$01AP$AAVString#Syste
m###Z)
libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol _MAIN__ refe
renced in function _main
test.exe : fatal error LNK1120: 3 unresolved externals
Here's the HandShakingTest.cpp:
#include "stdio.h"
#include <stdlib.h>
#include <Windows.h>
#using <System.DLL>
#using <System.Windows.Forms.DLL>
using namespace std;
using namespace System;
using namespace System::IO;
using namespace System::Diagnostics;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
extern "C" {void FortranShake(int&);}
int main(array<System::String ^> ^args)
{
Process^ testHand = gcnew Process();
testHand->StartInfo->UseShellExecute = false;
testHand->StartInfo->RedirectStandardInput = true;
testHand->StartInfo->RedirectStandardOutput = true;
testHand->StartInfo->ErrorDialog = true;
int numDebug = 0;
String^ returnedDebug = "Nothing";
FortranShake(numDebug);
StreamReader^ FromHandProcess = testHand->StandardOutput;
StreamWriter^ ToHandProcess = testHand->StandardInput;
String^ Line;
Line = FromHandProcess ->ReadLine();
if (Line->Equals("Enter Hand") )
{
Console::WriteLine(L"Hand Started!");
}
ToHandProcess ->WriteLine(numDebug.ToString());
returnedDebug = FromHandProcess ->ReadLine();
MessageBox::Show(returnedDebug);
return 0;
}
Here is the Fortran Subroutine:
SUBROUTINE FortranShake(GP_DEBUG)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INN = 5
WRITE(06,'(a)') 'Enter Hand'
READ(INN,*) GP_DEBUG
GP_DEBUG = GP_DEBUG + 55
WRITE(06,*) GP_DEBUG
RETURN
END
Your first error is actually a linker error - without the /c command line switch you are compiling and linking in one step. No Fortran code or object code has been provided.
Your second error is because:
You have specified (through omission) mismatching runtime libraries for the C++ and the Fortran. You need to decide whether you want to use static linking (the default for the current (as of today, but not necessarily as of next month...) release of Intel Fortran on windows) or dynamic linking (the default for the MS C++ compiler). Perhaps add /MD to the ifort command line, which specifies dynamic linking.
Without compiler options or directives to the contrary, the equivalent identifier for the Fortran procedure in C code as generated by that Fortran compiler is an upper case variant of the Fortran procedure's name - i.e. in the C++ code call the procedure FORTRANSHAKE. If you can write your Fortran code to the F2003 standard, you should use the C interoperability features of that language (BIND(C,...)) to control the C binding name of the Fortran procedure and ensure calling conventions, etc align.
The dummy argument of the Fortran subroutine has the DOUBLE PRECISION type specifier, which is equivalent to double in the C++ for this combination of compilers, not int. Again, F2003 introduces features that can make this alignment of argument types more robust.
I'm trying to build Rebol3 in Windows (it's for work) via vcbuild.bat, and getting an unresolved externals error. Here's a snippet from the process, the error happens at the bottom there.
<snip for brevity...>
host-lib.c
dev-stdio.c
dev-event.c
dev-file.c
dev-clipboard.c
link.exe /nologo /DEBUG /RELEASE /opt:ref /opt:icf /LTCG objs/a-constant
s.obj objs/a-globals.obj objs/a-lib.obj objs/b-boot.obj objs/b-init.obj objs/c-
do.obj objs/c-error.obj objs/c-frame.obj objs/c-function.obj objs/c-port.obj ob
js/c-task.obj objs/c-word.obj objs/d-crash.obj objs/d-dump.obj objs/d-print.obj
objs/f-blocks.obj objs/f-deci.obj objs/f-enbase.obj objs/f-extension.obj objs/
f-math.obj objs/f-modify.obj objs/f-random.obj objs/f-round.obj objs/f-series.o
bj objs/f-stubs.obj objs/l-scan.obj objs/l-types.obj objs/m-gc.obj objs/m-pool
s.obj objs/m-series.obj objs/n-control.obj objs/n-data.obj objs/n-io.obj objs/n
-loop.obj objs/n-math.obj objs/n-sets.obj objs/n-strings.obj objs/n-system.obj
objs/p-clipboard.obj objs/p-console.obj objs/p-dir.obj objs/p-dns.obj objs/p-ev
ent.obj objs/p-file.obj objs/p-net.obj objs/s-cases.obj objs/s-crc.obj objs/s-f
ile.obj objs/s-find.obj objs/s-make.obj objs/s-mold.obj objs/s-ops.obj objs/s-
trim.obj objs/s-unicode.obj objs/t-bitset.obj objs/t-block.obj objs/t-char.obj
objs/t-datatype.obj objs/t-date.obj objs/t-decimal.obj objs/t-event.obj objs/t-
function.obj objs/t-gob.obj objs/t-image.obj objs/t-integer.obj objs/t-logic.ob
j objs/t-map.obj objs/t-money.obj objs/t-none.obj objs/t-object.obj objs/t-pair
.obj objs/t-port.obj objs/t-string.obj objs/t-time.obj objs/t-tuple.obj objs/t-
typeset.obj objs/t-utype.obj objs/t-vector.obj objs/t-word.obj objs/u-bmp.obj
objs/u-compress.obj objs/u-dialect.obj objs/u-gif.obj objs/u-jpg.obj objs/u-md5
.obj objs/u-parse.obj objs/u-png.obj objs/u-sha1.obj objs/u-zlib.obj objs/host-
main.obj objs/host-args.obj objs/host-device.obj objs/host-stdio.obj objs/dev-n
et.obj objs/dev-dns.obj objs/host-lib.obj objs/dev-stdio.obj objs/dev-event.obj
objs/dev-file.obj objs/dev-clipboard.obj user32.lib ws2_32.lib advapi32.lib sh
ell32.lib comdlg32.lib /PDB:r3.pdb /OUT:r3.exe /SUBSYSTEM:WINDOWS
Creating library r3.lib and object r3.exp
f-math.obj : error LNK2001: unresolved external symbol _signbit
r3.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\link.exe"' : return code '0x460'
Stop.
C:\r3\make>
I've got a copy of the r3 repo from here, and I'm using MSVS 2010, which uses the "Microsoft (R) 32-bit C/C++ Optmizing Compiler Version 16.00.30319.01 for 80x86", in case that matters.
make prep (with the Win32 edition of make) errors with
REBOL System Error #1405: REBOL System Error
Program terminated abnormally.
This should never happen.
Please contact www.REBOL.com with details.
What am I doing wrong? What's the source of the issue? Is there a workaround?
For a workaround*, include the following right after the last #include in f-math.c
#include <float.h>
int signbit(double x) {
return (x == 0) ? _fpclass(x) & _FPCLASS_NZ : x < 0;
}
Be aware, though, that with that little modification you won't be able to compile under mingw, in case you want to try that.
* From the Rebol and Red chat some time ago.
I am compiling QCAR SDK, but it prompts an error after I added more frameworks to the project.
// Matrices.h
//
#ifndef _QCAR_MATRIX_H_
#define _QCAR_MATRIX_H_
namespace QCAR
{
/// Matrix with 3 rows and 4 columns of float items
struct Matrix34F {
float data[3*4]; ///< Array of matrix items
};
/// Matrix with 4 rows and 4 columns of float items
struct Matrix44F {
float data[4*4]; ///< Array of matrix items
};
} // namespace QCAR
#endif //_QCAR_MATRIX_H_
In the line namespace QCAR, it said Unknown type name 'namespace'.
What should I do?
UPDATE: Here is the build transcript
In file included from ../../build/include/QCAR/Tool.h:18:
In file included from /Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/ImageTargets/EAGLView.h:14:
In file included from /Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/ImageTargets/ImageTargetsAppDelegate.h:9:
In file included from /Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/CouponBook.m:12:
../../build/include/QCAR/Matrices.h:16:1: error: unknown type name 'namespace' [1]
namespace QCAR
^
../../build/include/QCAR/Matrices.h:16:15: error: expected ';' after top level declarator [1]
namespace QCAR
^
;
fix-it:"../../build/include/QCAR/Matrices.h":{16:15-16:15}:";"
In file included from /Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/ImageTargets/ImageTargetsAppDelegate.h:9:
In file included from /Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/CouponBook.m:12:
/Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/ImageTargets/EAGLView.h:52:5: error: type name requires a specifier or qualifier [1]
QCAR::Matrix44F projectionMatrix;
^
/Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/ImageTargets/EAGLView.h:52:10: error: expected expression [1]
QCAR::Matrix44F projectionMatrix;
^
/Users/Raptor.Kwok/Documents/xCodeProjects/qcar-ios-1-0-0/samples/ImageTargets/ImageTargets/EAGLView.h:52:5:{52:5-52:9}: warning: type specifier missing, defaults to 'int' [-Wimplicit-int,3]
QCAR::Matrix44F projectionMatrix;
^~~~
1 warning and 4 errors generated.
You can rename your file with .mm or you can select your .m file and change the "File Type" to "Objective-C++ Source".
I suspect the translation is C or Objective-C, where namespace is not a keyword as it is in C++ and Objective-C++.
Another possibility is that a previous header did not close a body (e.g. forgotten }; at end of class declaration of forgotten } at end of function definition).